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:

You need to console.log what bool is before your if statement. When you use for...in with an array, the variable bool is the index of the element in the array instead of the element of the array.

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: