1、对象属性的删除
function fun(){
 
this.name = 'mm';
 
}
 
var obj = new fun();
 
console.log(obj.name);//mm
 
delete obj.name;
 
console.log(obj.name); //undefined
2、变量不能删除
var name = 'lily';
delete name;
console.log(name); //lily
 
3、删除不了原型链中的变量
fun.prototype.age = 18;
delete obj.age;
console.log(obj.age) //18
posted on 2015-09-29 15:08  不想做菜鸟的学渣喵  阅读(490)  评论(0编辑  收藏  举报