摘要:
初识js的继承机制,整理一下,以备日后复习和查阅。 1 对象冒充function classA(color){ this.color=color; this.sayColor=function (){ alert("A:"+this.color); };}function classB(color,name){ this.newMethod=classA; this.newMethod(color); delete this.newMethod; this.name=name; this.sayName=function(){ alert("B:"+th 阅读全文