Falsy Bouncer algorithm - any help as to why this solution isn't working? - SOLVED

Hi guys,

Working on the falsy bouncer algorithm that removes false values from an array and thought I had made a solution but it doesn’t work with one combination:

solved

This solution is working for the other inputs, but for some reason null is not being removed and I am getting [1,null,2]. Any thoughts on why this is happening? I didn’t exactly use the “hints” they gave me because this jumped into my head as a possible solution immediately.

Thanks a bunch

Weird! When I did that while working on the solution null wasn’t being captured in the switch statement. Now it’s working. There were also some resources that stated null didn’t work in switch statements so I tried the if. Anyways, thanks a bunch!

I don’t see your code. I’m curious to see what you did.
Here’s mine:

Summary
function bouncer(arr) {
  // Don't show a false ID to this bouncer.
  var check = (x) => Boolean(x);
  return arr.filter(check);
}

bouncer([7, "ate", "", false, 9]);

side note: the arrow function was done afterwards just for kicks. I don’t think the FCC challenges console accepts them.

Wow, that’s amazingly simple!