Update indexOfAll description
forgot to update description
This commit is contained in:
@ -1,9 +1,9 @@
|
|||||||
### indexOfAll
|
### indexOfAll
|
||||||
|
|
||||||
Returns all indices of `val` in an array. If `val` never occurs, returns `[-1]`.
|
Returns all indices of `val` in an array. If `val` never occurs, returns `[]`.
|
||||||
|
|
||||||
Use `Array.forEach()` to loop over elements and `Array.push()` to store indices for matching elements.
|
Use `Array.forEach()` to loop over elements and `Array.push()` to store indices for matching elements.
|
||||||
Return `[-1]` if `length` of the array of indices is `0`, otherwise return the array of indices.
|
Return the array of indices.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const indexOfAll = (arr, val) => {
|
const indexOfAll = (arr, val) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user