原型链
利用原型链让一个引用类型继承另一个引用类型的方法和属性。
基本模式
function SuperType () {
this.property = true
}
.getSupervalue = function (){
return this.property
}
function SubType() {
this.subproperty = false
}
// 继承了SuperType
SubType.prototype = new SuperType()
SubType.prototype.getSubValue= function () {
return this.subproperty
}
var instance = new SubType()
alert(instance.getSubValue())