Possible Duplicate:(可能重复:) How to remove a property from a javascript object(如何从javascript对象中删除属性)
Possible Duplicate:
(可能重复:)
(如何从javascript对象中删除属性)
How can I remove an item from a JavaScript object?
(如何从JavaScript对象中删除项?)
Like this:
(像这样:)
var test = {'red':'#FF0000', 'blue':'#0000FF'}; test.remove('blue');
var test = {'red':'#FF0000', 'blue':'#0000FF'}; delete test.blue; // or use => delete test['blue']; console.log(test);
this deletes test.blue
(这会删除test.blue)
1.4m articles
1.4m replys
5 comments
56.9k users