Skip to content

getPath

Subhajit Sahu edited this page Jun 28, 2020 · 7 revisions

Gets value at index. 🏃 📼 📦 🌔 📒

Alternatives: get, getAll, [getPath].
Similar: [hasPath], [getPath].
Similar: get, set, remove.

iterable.get(x, i);
// x: an iterable
// i: index
const iterable = require('extra-iterable');

var x = [[2, 4], 6, 8];
iterable.getPath(x, [1]);
// 6

iterable.getPath(x, [0, 1]);
// 4

iterable.getPath(x, [0, 1, 2]);
// undefined

references

Clone this wiki locally