@extra-array/search-value-all
TypeScript icon, indicating that this package has built-in type declarations

2.10.19 • Public • Published

Finds indices of value. 📦 😺 🏃 📼 🌔 📜 📰 📘

Alternatives: searchValue, searchValueRight, searchValueAll.
Similar: search, scan, find.

This is part of package extra-array.


array.searchValueAll(x, v, [fc], [fm]);
// x:  an array
// v:  search value
// fc: compare function (a, b)
// fm: map function (v, i, x)
const array = require("extra-array");

var x = [1, 2, 3, 2, 5];
array.searchValueAll(x, 2);
// [ 1, 3 ] ^     ^

var x = [1, 2, 3, -2, 5];
array.searchValueAll(x, 2, (a, b) => Math.abs(a) - Math.abs(b));
// [ 1, 3 ] ^      ^

array.searchValueAll(x, 2, null, v => Math.abs(v));
// [ 1, 3 ] ^      ^


References

Package Sidebar

Install

npm i @extra-array/search-value-all

Weekly Downloads

10

Version

2.10.19

License

MIT

Unpacked Size

5.31 kB

Total Files

8

Last publish

Collaborators

  • wolfram77