title: Why does Array.filter(Number) filter zero out in JavaScript?
body: <p>I'm trying to filter all non-numeric elements out from an array. We can see the desired output when using typeof. But with Number, it filters zero out.</p>
  
  <p>Here's the example (tested in Chrome Console):</p>
  
  <pre><code>[-1, 0, 1, 2, 3, 4, Number(0), '', 'test'].filter(Number)
  // Which output with zero filtered out:
  [-1, 1, 2, 3, 4]  // 0 is filtered
  </code></pre>
  
  <p>If we use typeof, it doesn't filter zero, which was expected.</p>
  
  <pre><code>// code
  [-1, 0, 1, 2, 3, 4, Number(0), '', 'test'].filter(n =&gt; typeof n === 'number')
  // output
  [-1, 0, 1, 2, 3, 4, 0]
  </code></pre>
  
  <p>My question:</p>
  
  <ol>
  <li><p>What is the difference between the 'Number' and 'typeof' approaches?</p></li>
  <li><p>Number filters zero, but 'Number' itself literally contains zero, and this confuses me.</p></li>
  </ol>