如何从JavaScript对象中删除项目

可能重复:
如何从javascript对象中移除一个属性

我如何从JavaScript对象中删除项目?

喜欢这个:

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);
链接地址: http://www.djcxy.com/p/4661.html

上一篇: How to remove item from a JavaScript object

下一篇: How do I remove a key from a JavaScript object?