{} + [] in Javascript
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/9032856/what-is-the-explanation-for-these-bizarre-javascript-behaviours-mentioned-in-the">What is the explanation for these bizarre JavaScript behaviours mentioned in the &#39;Wat&#39; talk for CodeMash 2012?</a>  </p>
</blockquote>



<p>When I type </p>

<pre><code>{} + []
</code></pre>

<p>in the Google Chrome JavaScript console, I get </p>

<pre><code>0
</code></pre>

<p>as a result. However, when I type</p>

<pre><code>Function("return {} + []")()
</code></pre>

<p>I get</p>

<pre><code>"[object Object]"
</code></pre>

<p>as a result. I would think that both operations should return the same result, as one is simply a wrapper around the other. Why do they return different results?</p>
