There was an error while loading. Please reload this page.
Remove value at path in a nested object.
Similar: hasPath, getPath, removePath$. Similar: get, set, swap, remove.
function removePath$(x, p) // x: a nested object (updated) // p: path
const object = require('extra-object'); var x = {a: {b: 2, c: 3}, d: 4}; object.removePath$(x, ['d']); // → { a: { b: 2, c: 3 } } x; // → { a: { b: 2, c: 3 } } object.removePath$(x, ['a', 'b']); // → { a: { c: 3 } } object.removePath$(x, ['a', 'b', 'c']); // → { a: { c: 3 } }