-
Notifications
You must be signed in to change notification settings - Fork 5
getPath
Subhajit Sahu edited this page Jun 28, 2020
·
11 revisions
Gets value at index. 🏃 📼 📦 🌔 📒
Alternatives: get, getAll, [getPath].
Similar: get, set, remove.
array.get(x, i);
// x: an array
// i: index (-ve: from right)
const array = require('extra-array');
var x = [[2, 4], 6, 8];
array.getPath(x, [1]);
// 6
array.getPath(x, [0, 1]);
// 4
array.getPath(x, [0, 1, 2]);
// undefined