组合继承优化里的constroctor是原型对象里的方法吗?
来源:3-13 面向对象(二)

沧海的雨季
2019-04-27
子类实例上找不到constroctor,所以去原型对象里找
子类原型对象又等于了父类的实例
父类实例的原型对象controctor等于父类构造函数
是这样理解吗?
function Parent1(){
this.name='parent1';
}
function Child1(){
Parent1.call(this);
this.type='child1';
}
Child1.prototype=new Parent1();
// console.log(new Child1())
写回答
2回答
-
沧海的雨季
提问者
2019-04-28
老师,这里讲的不是原型对象上有的constructor?
00 -
快乐动起来呀
2019-04-28
你搞的太复杂了,只有类才有construtor,为啥不按课程的讲解来理解呢
012019-04-28
相似问题