title: JavaScript equality transitivity is weird
body: <p>I've been reading <a href="https://rads.stackoverflow.com/amzn/click/com/0596517742" rel="noreferrer" rel="nofollow noreferrer">Douglas Crockford's <em>JavaScript: The Good Parts</em></a>, and I came across this weird example that doesn't make sense to me:</p>
  
  <pre><code>'' == '0'           // false
  0 == ''             // true
  0 == '0'            // true
  
  false == undefined  // false
  false == null       // false
  null == undefined   // true
  </code></pre>
  
  <p>The author also goes on to mention "to never use <code>==</code> and <code>!=</code>. Instead, always use <code>===</code> and <code>!==</code>". However, he doesn't explain why the above behavior is exhibited? So my question is, why are the above results as they are? Isn't transitivity considered in JavaScript?</p>