title: In JavaScript, why is "0" equal to false, but when tested by 'if' it is not false by itself?
body: <p>The following shows that <code>"0"</code> is false in Javascript:</p>
  
  <pre><code>&gt;&gt;&gt; "0" == false
  true
  
  &gt;&gt;&gt; false == "0"
  true
  </code></pre>
  
  <p>So why does the following print <code>"ha"</code>?</p>
  
  <pre><code>&gt;&gt;&gt; if ("0") console.log("ha")
  ha
  </code></pre>