<script>
function Father(name,age){
this.name=name;
this.age=age;
}
function son(name,age){
Father.call(this,name,age);
}
var ss=new son("bob",22);
console.log(ss.name);
</script>
<script>
function Father(name,age){
this.name=name;
this.age=age;
}
Father.prototype.money=function(){
console.log(10000);
}
function son(name,age){
Father.call(this,name,age);
}
son.prototype=new Father();
son.prototype.constructor=son;
var ss=new son("bob",22);
console.log(ss.money());
</script>