README
Removes value at path in a nested object. :running: :vhs: :package: :moon: :ledger:
Alternatives: remove, remove$, removePath$.
Similar: hasPath, getPath, setPath$, removePath$.
Similar: get, set, remove.
This is part of package extra-object.
This is browserified, minified version of @extra-object/remove-path-update.
It is exported as global variable object_removePath$.
CDN: unpkg, jsDelivr.
object.removePath$(x, p);
// x: a nested object (updated)
// p: path
// --> x
const object = require('extra-object');
var x = {a: {b: 2, c: 3}, d: 4};
object.removePath$(x, ['d'], 40);
// { a: { b: 2, c: 3 } }
x;
// { a: { b: 2, c: 3 } }
object.removePath$(x, ['a', 'b'], 20);
// { a: { c: 3 } }
object.removePath$(x, ['a', 'b', 'c'], 30);
// { a: { c: 3 } }