We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Remove value at path in a nested map.
Similar: hasPath, getPath, setPath$, removePath$. Similar: get, set, remove.
function removePath$(x, p) // x: a nested map (updated) // p: path
const map = require('extra-map'); var x = new Map([['a', 2], ['b', 4], ['c', 6]]); var y = new Map([['x', x], ['e', 10], ['f', 12]]); map.removePath$(y, ['e']); // → Map(2) { 'x' => Map(3) { 'a' => 2, 'b' => 4, 'c' => 6 }, 'f' => 12 } y; // → Map(2) { 'x' => Map(3) { 'a' => 2, 'b' => 4, 'c' => 6 }, 'f' => 12 } map.removePath$(y, ['x', 'b']); // → Map(2) { 'x' => Map(2) { 'a' => 2, 'c' => 6 }, 'f' => 12 } map.removePath$(y, ['x', 'b', 'c']); // → Map(2) { 'x' => Map(2) { 'a' => 2, 'c' => 6 }, 'f' => 12 } (no effect)