In JavaScript, why do []+[] return empty string, []+{} return Object, {}+[] return 0, and {}+{} return NaN?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/9032856/can-anyone-explain-these-bizarre-javascript-behaviours-mentioned-in-the-wat-ta">Can anyone explain these bizarre Javascript behaviours mentioned in the &#39;Wat&#39; talk for CodeMash 2012?</a>  </p>
</blockquote>



<p>Someone I know gave me these examples as a reason why he can't consider javascript a proper programming language, or something along the line.</p>

<p>I was wondering if there are some reasons for these return values?</p>

<p>For the first one, I guess an explanation could be, that <code>[]==""</code> returns true? And therefore <code>[]+[]</code> is 'equivalent' to <code>""+""</code>? But if that's right, since <code>[]==0</code> returns true too, why is the empty string interpretation chosen over 0?</p>
