对象属性删除
function fun(){
this.name = 'mm';
}
var obj = new fun();
console.log(obj.name);//mm
delete obj.name;
console.log(obj.name); //undefined
不能删除变量
var name ='lily';
delete name;
console.log(name);//lily
即直接用delete删除不了变量
不能删除从原型链继承的属性
Object.prototype.a = 18;
let obj = {};
delete obj.a;//false
console.log(obj.a)//18
delete Object.prototype.a;//true
console.log(obj.a)//undefined