indexOfAll
Finds all indexes of val
in an array.
If val
never occurs, returns an empty array.
- Use
Array.prototype.reduce()
to loop over elements and store indexes for matching elements.
Finds all indexes of val
in an array.
If val
never occurs, returns an empty array.
Array.prototype.reduce()
to loop over elements and store indexes for matching elements.