Falsy bouncer code doesn't work

Not sure why this doesn’t work and unsure where to go from here.

function bouncer(arr) {
//Don't show a false ID to this bouncer.// 
  function getItOut(value) {
for (var i = 0; i < arr.length ; i++) {
if ( arr[i] === false ) {
 return value;
}
} return arr.filter(getItOut);
} 
}                        
bouncer(["a", "b", "c"]);

@okdatapad what is the result of passing ["a", "b", "c"], to bouncer()?

I edited your post a bit. You used the code formatting backticks, which is great, but they need to be on their own lines for the formatting to work. I also added spoiler tags because we’re looking at one of the challenges.

nothing, i just get a blank box

You are using strict equality which checks the value as well as the type.

The elements in the array are strings and false is a boolean so the comparison will always be false.

I changed it to

 arr[i] !== true

and it still doesn’t work.

You’re using “arr” instead of the local variable “value” and you’ll probably want to change it from arr[i] === false to arr[i] !== false, or falseValues.indexOf(arr[i]) === -1 where falseValues is an array of false values.

How do you get your code to color and format like that?

You’re also misusing filter. Filter iterates over the entire array, there’s no need to use a for loop.

You should just do it as a callback

I got rid of the for loop and it worked, I have no idea why though lol

Yeah that’s weird. return arr.filter(function(x){ return x }); works.