📌  相关文章
📜  如何在javascript代码示例中删除对象属性

📅  最后修改于: 2022-03-11 15:03:16.634000             🧑  作者: Mango

代码示例2
// Creates a new object, myobj, with two properties, a and b.
var myobj = new Object;
myobj.a = 5;
myobj.b = 12;

// Removes the a property, leaving myobj with only the b property.
delete myobj.a;
console.log ('a' in myobj); // output: "false"