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.
Get value at path in a nested object.
Similar: hasPath, getPath, removePath$. Similar: get, getAll, getPath. Similar: get, set, swap, remove.
function getPath(x, p) // x: a nested object // p: path
const object = require('extra-object'); var x = {a: {b: 2, c: 3}, d: 4}; object.getPath(x, ['d']); // → 4 object.getPath(x, ['a', 'b']); // → 2 object.getPath(x, ['a', 'b', 'c']); // → undefined