1.1.7 • Published 5 years ago

@extra-array/indices-of v1.1.7

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

Get indices of all values in array equal to specified value, like Array.indexOf().

const indicesOf = require('@extra-array/indices-of');
// indicesOf(<array>, <search value>, [begin=0], [end], [target=[]], [at])

indicesOf(['r', 'o', 'b', 'o'], 'o');
// [1, 3]
indicesOf(['r', 'o', 'b', 'o'], 'o', 1);
// [1, 3]
indicesOf(['r', 'o', 'b', 'o'], 'o', 1, 3);
// [1]
indicesOf(['r', 'o', 'b', 'o'], 'o', 1, 3, [10, 11]);
// [10, 11, 1]
indicesOf(['r', 'o', 'b', 'o'], 'o', 1, 3, [10, 11], 1);
// [10, 1]

With extra-array try Array.indicesOf() 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