function SuperType(){ this.property = true;}SuperType.prototype.getSuperValue = function(){ return this.property;};function SubType(){ this.subproperty = false;}//继承了SuperTypeSubType.prototype = new SuperType();SubType.prototype.getSubValue = function (){ return this.subproperty;};var instance = new SubType();alert(instance.getSuperValue()); //true我试了下SubType原型确实没有constructor,但他不是有构造函数声明吗?
1 回答
qq_花开花谢_0
TA贡献1835条经验 获得超7个赞
SubType
的原型 有 constructor
,不信你试试
SubType.prototype.constructor === SuperType
添加回答
举报
0/150
提交
取消