-
Notifications
You must be signed in to change notification settings - Fork 1
getPath
Subhajit Sahu edited this page Feb 3, 2021
·
7 revisions
Get value at path in a nested iterable.
Alternatives: get, getAll, getPath.
Similar: hasPath, getPath.
Similar: get, set, remove.
function getPath(x, p)
// x: a nested iterable
// p: path
const xiterable = require('extra-iterable');
var x = [[2, 4], 6, 8];
xiterable.getPath(x, [1]);
// → 6
xiterable.getPath(x, [0, 1]);
// → 4
xiterable.getPath(x, [0, 1, 2]);
// → undefined