Falsy Bouncer - why does this not work?

You can get this going in many ways but I just don’t understand why this is not working.
I understand “for…in” is not recommended for array but more for properties but still, would like to know what is wrong with this version.

function bouncer(arr) {

let newArr = ;
for (var bool in arr) {
if (bool) newArr.push(bool);

}

return newArr;
}

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

Link to the challenge:

I appreciate it, thank you.

I will start using the console.log as a debug “tool”. I spent quite a lot of time in the browser’s dev mode trying to find a smart way to insert a check point and watch variables (the way I could do in VS environment)… with no success. I wish I would have more control on the debug side, I am sure there are ways out there …unknown to me yet :slight_smile:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.