Files
30-seconds-of-code/test/indexOfAll/indexOfAll.js
2018-01-09 06:09:49 -05:00

5 lines
126 B
JavaScript

module.exports = (arr, val) => {
const indices = [];
arr.forEach((el, i) => el === val && indices.push(i));
return indices;
};