The delete
operator allows you to remove a property from an object.
(delete
运算符允许您从对象中删除属性。)
The following examples all do the same thing.
(以下示例都做同样的事情。)
// Example 1
var key = "Cow";
delete thisIsObject[key];
// Example 2
delete thisIsObject["Cow"];
// Example 3
delete thisIsObject.Cow;
If you're interested, read Understanding Delete for an in-depth explanation.
(如果您有兴趣,请阅读《 了解删除》以获取详细说明。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…