#冒充

js一种继承机制:用对象冒充继承构造函数的属性,用原型prototype继承对象的方法。

js一种继承机制:用对象冒充继承构造函数的属性,用原型prototype继承对象的方法。functionClassA(sColor){this.color=sColor;}ClassA.prototype.sayColor=function(){alert(this.color);};functionClassB(sC...