Tell us what’s happening:
Describe your issue in detail here.
Your code so far
function bouncer(arr) {
let newArr = [];
for(let i = 0; i < arr.length; i++){
if(Boolean(arr[i]) === true){
newArr.push(arr[i]);
return newArr;
}
}
}
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/107.0.0.0 Safari/537.36
Challenge: Basic Algorithm Scripting - Falsy Bouncer
Hey everyone, am stuck on why my code cant work,please someone to review and correct me…thanks.
Link to the challenge: