delete 运算符使用
var obj = {}; Object.defineProperty(obj,'x',{ configurble:true, value:1});
当configurable的值为true时:
delete obj.x obj.x //undefined
当configurable的值为false时:
delete obj.x obj.x //undefined
以上就是JavaScript中delete的用法了
博客列表 >javascript中delete的运用
delete 运算符使用
var obj = {}; Object.defineProperty(obj,'x',{ configurble:true, value:1});
当configurable的值为true时:
delete obj.x obj.x //undefined
当configurable的值为false时:
delete obj.x obj.x //undefined
以上就是JavaScript中delete的用法了