title: Why {} + {} is NaN only on the client side? Why not in Node.js?
body: <p>While <code>[] + []</code> is an empty string, <code>[] + {}</code> is <code>"[object Object]"</code>, and <code>{} + []</code> is <code>0</code>. Why is <code>{} + {}</code> NaN?</p>
  
  <pre><code>&gt; {} + {}
    NaN
  </code></pre>
  
  <p>My question isn't why <code>({} + {}).toString()</code> is <code>"[object Object][object Object]"</code> while <code>NaN.toString()</code> is <code>"NaN"</code>, <a href="https://stackoverflow.com/a/9033306/1348195">this part has an answer here already</a>.</p>
  
  <p>My question is why does this happen only on the client side? On the server side (<a href="http://en.wikipedia.org/wiki/Node.js" rel="noreferrer">Node.js</a>) <code>{} + {}</code> is <code>"[object Object][object Object]"</code>.</p>
  
  <pre><code>&gt; {} + {}
  '[object Object][object Object]'
  </code></pre>
  
  <hr>
  
  <p><strong>Summarizing</strong>:</p>
  
  <p>On the client side:</p>
  
  <pre><code> [] + []              // Returns ""
   [] + {}              // Returns "[object Object]"
   {} + []              // Returns 0
   {} + {}              // Returns NaN
  
   NaN.toString()       // Returns "NaN"
   ({} + {}).toString() // Returns "[object Object][object Object]"
   var a = {} + {};     // 'a' will be "[object Object][object Object]"
  </code></pre>
  
  <p>In Node.js:</p>
  
  <pre><code> [] + []   // Returns "" (like on the client)
   [] + {}   // Returns "[object Object]" (like on the client)
   {} + []   // Returns "[object Object]" (not like on the client)
   {} + {}   // Returns "[object Object][object Object]" (not like on the client)
  </code></pre>