Tell us what’s happening:
It filters everything but also filters the string “ate” in the first test case and the “a”, “b”, “c” strings in the second.
Why does this filter the string in the array, I have been looking for an answer for hours?
Your code so far
function bouncer(arr) {
// Don't show a false ID to this bouncer.
var item;
return arr.filter(function(item) {
return item !== false &&
item !== null &&
item !== 0 &&
item !== "" &&
item !== undefined &&
!isNaN(item);
});
}
bouncer([7, "ate", "", false, 9]);
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36.
Link to the challenge:
https://www.freecodecamp.org/challenges/falsy-bouncer