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的用法了
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号