A javascript library for working with objects
Deletes a property from an object, if the property exists.
Param | Type | Description |
---|---|---|
object | object |
An object. |
key | string |
The key to delete. |
Example
import { erase } from 'object-agent';
const foo = {
bar: 1,
also: 2
};
erase(foo, 'bar');
console.log(foo);
// => {also: 2}