delete 運(yùn)算符使用
var obj = {}; Object.defineProperty(obj,'x',{ configurble:true, value:1});
當(dāng)configurable的值為true時(shí):
delete obj.x obj.x //undefined
當(dāng)configurable的值為false時(shí):
delete obj.x obj.x //undefined
以上就是JavaScript中delete的用法了
微信掃碼
關(guān)注PHP中文網(wǎng)服務(wù)號(hào)
QQ掃碼
加入技術(shù)交流群
Copyright 2014-2025 http://ipnx.cn/ All Rights Reserved | php.cn | 湘ICP備2023035733號(hào)