$#Falsy Bouncer$%#$

$#Falsy Bouncer$%#$
0.0 0

#1

Tell us what’s happening:
Test case 1 ,2 seem conflict with test case 3, 4

Your code so far

function bouncer(arr) {
  // Don't show a false ID to this bouncer.
  var nwarr = [];
  for (i=0;i<arr.length;i++) 
  {
    if (arr[i] != "false" && arr[i] != "" && arr[i] != 0 && isNaN(arr[i]) == false && arr[i] != null && arr[i] != undefined) 
      {  nwarr.push(arr[i]); }
           
  }  

  return nwarr;

}

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

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36.

Link to the challenge:


#2

It’s fully doable, you need to change your logic. Think about what you get when you do isNaN(“ate”) and the behavior of your current code.