如何感觉delete this.newMethod;加不加无所谓
怎么感觉delete this.newMethod加不加无所谓?function classA(){this.nameMichaelthis.sayfunction()
怎么感觉delete this.newMethod;加不加无所谓?
function classA(){
this.name="Michael"
this.say=function(){alert(this.name)}
}
function classZ(){
this.sayBye=function (){
alert(886)
}
}
function classB(){
this.newMethod=classA;
this.newMethod();
//delete this.newMethod;
this.newMethod=classZ;
this.newMethod();
//delete this.newMethod;
this.name='jackson';
this.sayName=function (){alert(this.name)}
}
b=new classB
a=new classA
z=new classZ
b.sayName();
a.say();
不加delete this.newMethod超类的属性也没被覆盖啊?
[解决办法]
[解决办法][解决办法]仅仅是冒充而已。
并不是真的。
--------
[解决办法]