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,刪除不了原型鏈中的變數刪除不符屬性及變數)相關文章請關注PHP中文網!