<sctript>
//1.创建父类
function Parent(){
this.name = name;
}
Parent.prototype.age = 20;
//2.创建子类
function Child(){
Parent.call(this,"zhangsan");
}
//3.确立继承关系
Child.prototype = Object.create(Parent.prototype);
//4.改变构造器
Chils.prototype.constuctor = Child;
</script>