function parent(){
this.name="lily";
this.method=function(){
alert("ok");
}
};
function son(){
this.age=18;
};
son.prototype = new parent();
var new_son= new son();
console.log(new_son.name); //lily
</script>
function parent(){
this.name="lily";
this.method=function(){
alert("ok");
}
};
function son(){
this.age=18;
};
son.prototype = new parent();
var new_son= new son();
console.log(new_son.name); //lily
</script>