2.2.10 • Published 4 years ago

@extra-lists/get-path v2.2.10

Weekly downloads
19
License
MIT
Repository
github
Last release
4 years ago

Gets value at path in nested lists. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:

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

This is part of package extra-lists.

lists.getPath(x, p);
// x: nested lists
// p: path
const lists = require('extra-lists');

var x = [['a', 'b', 'c'], [2, 4, 6]];
var y = [['x', 'e', 'f'], [x, 10, 12]];
lists.getPath(y, ['e']);
// 10

lists.getPath(y, ['x', 'b']);
// 4

lists.getPath(y, ['x', 'b', 'c']);
// undefined

References

2.2.10

4 years ago

2.2.9

4 years ago

2.2.8

4 years ago

2.2.7

4 years ago

2.2.5

5 years ago

2.2.4

5 years ago

2.2.3

5 years ago

2.2.2

5 years ago

2.2.0

5 years ago

2.1.8

5 years ago

2.1.7

5 years ago

2.1.6

5 years ago