Tell us what’s happening:
I know that changing my If statement (let i = 0;…) with (x of array) it will work.
But, Why it doesn 't work, if the value is the same (x / array[i])?
Your code so far
function bouncer(arr) {
let newArr = [];
for (let i = 0; i < arr; i++) {
if (arr[i]) {
newArr.push(arr[i]);
}
}
return newArr;
};
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64; rv:145.0) Gecko/20100101 Firefox/145.0
Challenge Information:
Implement a Falsy Remover - Implement a Falsy Remover