Tell us what’s happening:
How does condition “if” passing new array works? kinda confused a bit, I just copied code from hint
Your code so far
function bouncer(arr) {
const filterRR = [];
for (let i = 0; i < arr.length; i++) {
if (arr[i]) filterRR.push(arr[i]);
}
return filterRR;
}
bouncer([7, "ate", "", false, 9]);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Challenge: Basic Algorithm Scripting - Falsy Bouncer
Link to the challenge: