2.2.10 • Published 3 years ago

@extra-lists/search-value-all v2.2.10

Weekly downloads
20
License
MIT
Repository
github
Last release
3 years ago

Finds keys with given value. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:

Alternatives: searchValue, searchValueAll. Similar: search, searchValue.

This is part of package extra-lists.

lists.searchValueAll(x, v, [fc], [fm]);
// x:  lists
// v:  search value
// fc: compare function (a, b)
// fm: map function (v, k, x)
const lists = require('extra-lists');

var x = [['a', 'b', 'c', 'd', 'e'], [1, -2, 3, 2, 5]];
[...lists.searchValueAll(x, 2)];
// [ 'd' ]                                ^

[...lists.searchValueAll(x, 2, (a, b) => Math.abs(a) - Math.abs(b))];
// [ 'b', 'd' ]      ^                    ^

[...lists.searchValueAll(x, 2, null, v => Math.abs(v))];
// [ 'b', 'd' ]      ^                    ^

References

2.2.10

3 years ago

2.2.9

3 years ago

2.2.8

3 years ago

2.2.7

3 years ago

2.2.5

3 years ago

2.2.4

4 years ago

2.2.3

4 years ago

2.2.2

4 years ago

2.2.0

4 years ago

2.1.3

4 years ago

2.1.6

4 years ago

2.1.5

4 years ago

2.1.8

4 years ago

2.1.7

4 years ago

2.1.2

4 years ago

2.1.1

4 years ago

2.0.91

4 years ago

2.1.0

4 years ago

2.0.90

4 years ago

2.0.89

4 years ago

2.0.88

4 years ago