A javascript library for working with objects
Deletes a property from a nested object.
Returns: object
- The mutated object.
Param | Type | Description |
---|---|---|
object | object |
The object to mutate. |
path | string |
Dot delimited string. |
Example
import { unset } from 'object-agent';
const thing = {
a: [{
b: 'c'
}, {
b: 'd'
}]
};
unset(thing, ['a.1.b']);
console.log(thing);
// => {
// a: [{ b: 'c' }, {}]
//}