Closed RazvanBugoi closed 4 years ago
function binaryCleaner(arr) {
let smallerThanTwo = arr.filter((element) => element < 2);
let indices = [];
for (let i=0; i<arr.length; i++) {
if (arr[i] > 1) indices.push(i);
}
return [smallerThanTwo, indices];
}
https://www.codewars.com/kata/5b5097324a317afc740000fe/train/javascript