Register now or log in to join your professional community.
Theres is tow Option:
1- Delete is the true way to remove object's properties without any leftovers, but it works slow
2- setting object[key] = undefined.
Example:
Delete:
Var obj ={ feild:1 };
delete obj.feild;
Undefined:
Var obj ={ feild:1 };
obj.feild=undefined;
this may help you
var myObject = { "ircEvent": "PRIVMSG", "method": "newURI", "regex": "^http://.*" }; delete myObject.regex;
using "delete" keyword
Example:
delete myObject.aProperty;
You can Use Delete Statement to remove this.
eg. Delete obj.property
Simply use the Delete key word
Example:
var test ={'red':'#FF','blue':'#FF'};
delete test.blue;