1.1.7 • Published 5 years ago

@extra-array/find-all-indices v1.1.7

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

Get indices of all values in array that satisfy the test, like Array.findIndex().

const findAllIndices = require('@extra-array/find-all-indices');
// findAllIndices(<array>, <test function>, [this], [begin=0], [end], [target=[]], [at])
// - <test function>(<value>, <index>, <array>)

findAllIndices(['a', 'b', 'cd'], (v) => v>'b');
// [2]
findAllIndices(['a', 'b', 'c', 'd'], (v, i, arr) => v>'b', null, 1);
// [2, 3]
findAllIndices(['a', 'b', 'c', 'd'], (v, i, arr) => v>'b', null, 1, 3);
// [2]
findAllIndices(['a', 'b', 'c', 'd'], (v, i, arr) => v>'b', null, 1, 3, [10, 11]);
// [10, 11, 2]
findAllIndices(['a', 'b', 'c', 'd'], (v, i, arr) => v>'b', null, 1, 3, [10, 11], 1);
// [10, 2]

With extra-array try Array.findAllIndices() instead.

extra-array

1.1.7

5 years ago

1.1.6

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.6

5 years ago

1.0.4

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago