How to remove item from a JavaScript object

Possible Duplicate:
How to remove a property from a javascript object

How can I remove an item from a JavaScript object?

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

上一篇: 删除JSON属性

下一篇: 如何从JavaScript对象中删除项目