title: How to filter() out NaN, null, 0, false in an array (JS)
body: <p>I was asked to filter out <strong>NaN, null, 0, false</strong> in an <strong>array</strong>.</p>
  
  <p>Luckily I have answered the question. </p>
  
  <pre><code>function bouncer(arr) {
    function filterer(arr) {
       return arr &gt; 0|| isNaN(arr) === true;
    }
    arr = arr.filter(filterer);
    return arr;
  }
  
  //example input
  bouncer([0, 1, 2, 3, 'ate', '', false]); //output [1, 2, 3, 'ate']
  </code></pre>
  
  <p>but the thing is I really don't know how I came up with the answer or rather I don't know how it works. Specially on <strong>arr > 0</strong> how did the filter know that arr is alread on arr[1], arr[2], etc.. without using a loop to iterate in all array.</p>
  
  <p>or can simply just explain on how to code works. [I've tried to explain it clearly ---]</p>