标签:prototype cti bsp log function ret val 面向 instance
继承:
原型链继承
function SuperType() {
this.propperty = true;
}
Supertype.prototype.getSuperValue = function() {
return this.propperty;
}
function SubType() {
this.subproperty = false;
}
// 继承了SubType
SubType.prototype = new SuperType();
SubType.prototype.getSubValue = function () {
return this.subproperty;
}
var instance = new SubType();
console.log(instance.getSuperValue()); // true
标签:prototype cti bsp log function ret val 面向 instance
原文地址:http://www.cnblogs.com/lzj0824/p/6979230.html