There was an error while loading. Please reload this page.
Get value at path in a nested map.
Similar: get, getAll, getPath, setPath$, removePath$. Similar: get, set, remove.
function getPath(x, p) // x: a nested map // 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.getPath(y, ['e']); // → 10 map.getPath(y, ['x', 'b']); // → 4 map.getPath(y, ['x', 'b', 'c']); // → undefined