关于delete

delete 删除当前对象的属性或方法

function Person(){

}

Person.prototype.eat=function(){
       alert('person eat');
}

var gg=new Person();
gg.eat=function(){ 
      alert('gg eat');
}
delete gg.eat;
gg.eat(); //alert person eat

总结:

             delete 只删除当前对象中的值,而不会删除prototype中的值。

    如果要删除prototype中的值,使用delete Person.prorotype.eat

原文地址:https://www.cnblogs.com/BigIdiot/p/3080354.html