js delete删除对象属性,delete删除不了变量及原型链中的变量
js delete删除对象属性,delete删除不了变量及原型链中的变量一、delete删除对象属性function fun(){this.name = 'gg';}var obj = new fun();console.log(obj.name);//ggdelete obj.name;console.log(obj.name); //undefined二、delete删除不了变量var name = 'gg';delete name;console.log(name); //gg三、delete删除不了原型链的变量fun.prototype.age = 11;delete obj.age;console.log(obj.age) //11