「javaScript入門」Object.create()を利用するサンプル
JSコード
var user = {
hometown:"oosaka",
hobby:"game",
address:"kawasaki",
jobInfo:function(){
return “driver";
}
}
var emp = Object.create(user)
console.log(emp.hometown); //oosaka
console.log(emp.hobby); //game
console.log(emp.address); //kawasaki
console.log(emp.jobInfo()); //driver