How do we remove a property from a JavaScript object ?
WE wanted to do a function that removes by key:
The delete operator allows we to remove a property from an object.
The following examples all do the same thing.
If you're interested, read Understanding Delete for an in-depth explanation.
If we are using Underscore.js or Lodash, there is a function 'omit' that will do it.
http://underscorejs.org/#omit
If we want to modify the current object, assign the returning object to the current object.
With pure JavaScript, use:
Another option with pure JavaScript.
If we are using a JavaScript shell, it's as easy as: