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
直接用delelte刪除不了變數
3,刪除不了原型鏈中的變數
fun.prototype.age = 18; delete obj.age; console.log(obj.age) //18