Finds indices of values passing a test.
npm install @extra-array/find-indicesFinds indices of values passing a test. [:running:] [:vhs:] [:package:] [:moon:] [:ledger:]
> Alternatives: [findIndex], [findIndices].
> Similar: [find], [findIndex].
> This is part of package [extra-array].
[extra-array]: https://www.npmjs.com/package/extra-array
``javascript`
array.findIndices(x, fn);
// x: an array
// fn: test function (v, i, x)
`javascript
const array = require('extra-array');
var x = [1, 2, 3, 4, 5];
array.findIndices(x, v => v % 2 == 0);
// [ 1, 3 ] ^ ^
array.findIndices(x, v => v % 2 == 1);
// [ 0, 2, 4 ] ^ ^
``
- Data.List.findIndices: Haskell
- List-Extra.findIndices: elm
- find-array: @hdkhoa162
[:running:]: https://npm.runkit.com/@extra-array/find-indices
[:package:]: https://www.npmjs.com/package/@extra-array/find-indices
[:moon:]: https://www.npmjs.com/package/@extra-array/find-indices.min
[:ledger:]: https://unpkg.com/@extra-array/find-indices/
[findIndex]: https://github.com/nodef/extra-array/wiki/findIndex
[findIndices]: https://github.com/nodef/extra-array/wiki/findIndices
[find]: https://github.com/nodef/extra-array/wiki/find
[:vhs:]: https://asciinema.org/a/332049