indexOfAll.md returns a functions with shadow vars

It returned a function that accepted the same arguments again that when run again with the same inputs would eventually result
This commit is contained in:
Robert Mennell
2018-08-02 12:57:02 -07:00
committed by GitHub
parent 43af1264ee
commit a24423d5c6

View File

@ -6,7 +6,7 @@ Use `Array.reduce()` to loop over elements and store indices for matching elemen
Return the array of indices.
```js
const indexOfAll = (arr, val) => (arr, val) =>
const indexOfAll = (arr, val) =>
arr.reduce((acc, el, i) => (el === val ? [...acc, i] : acc), []);
```