类冒充
function parent(){
this.x=10;
} function child(){
this.parent=parent;
this.parent();
delete this.parent;
} var childObj=new child();
alert(childObj.x);
function parent(){
this.x=10;
} function child(){
parent.call(this);
} var childObj=new child();
alert(childObj.x);
|