-
Notifications
You must be signed in to change notification settings - Fork 0
getPath
Subhajit Sahu edited this page Jun 28, 2020
·
7 revisions
Gets value at path in nested entries. 🏃 📼 📦 🌔 📒
Alternatives: get, getAll, getPath.
Similar: hasPath, getPath.
Similar: get, set, remove.
entries.getPath(x, p);
// x: nested entries
// p: path
const entries = require('extra-entries');
var x = [['a', 2], ['b', 4], ['c', 6]];
var y = [['x', x], ['e', 10], ['f', 12]];
entries.getPath(y, ['e']);
// 10
entries.getPath(y, ['x', 'b']);
// 4
entries.getPath(y, ['x', 'b', 'c']);
// undefined