Faulty Bouncer bonfire stuck

Faulty Bouncer bonfire stuck
0

#1

function bouncer(arr) {
// Don’t show a false ID to this bouncer.
function nonFalse(){
for (i=0;i<arr.length;i++){
if (arr[i]===true){

   arr.filter(nonFalse);
  }
}

}
return arr;
}

bouncer([7, “ate”, “”, false, 9]);

So, what’s wrong with the code(except excessive curly braces, but they’re not error), some hunch?


#4

That is a great explanation, thanks! I haven’t actually read anywhere that filter returns only truthy elements, but maybe I was overwhelmed while reading Mozilla references and other online resources…
Could you just explain the “=>” - when do we use it - haven’t come across that yet on fcc?