Travis build: 1091

This commit is contained in:
30secondsofcode
2018-01-08 21:26:01 +00:00
parent 2629765340
commit 949dbb6196
2 changed files with 4 additions and 4 deletions

View File

@ -874,7 +874,7 @@ Return `[-1]` if `length` of the array of indices is `0`, otherwise return the a
const indexOfAll = (arr, val) => {
const indices = [];
arr.forEach((el, i) => el === val && indices.push(i));
return indices.length ? indices : [-1];
return indices;
};
```
@ -883,7 +883,7 @@ const indexOfAll = (arr, val) => {
```js
indexOfAll([1, 2, 3, 1, 2, 3], 1); // [0,3]
indexOfAll([1, 2, 3], 4); // [-1]
indexOfAll([1, 2, 3], 4); // []
```
</details>