Why {} + {} is NaN only on the client side? Why not in Node.js?
While [] + [] is an empty string, [] + {} is "[object Object]" , and {} + [] is 0 . Why is {} + {} NaN? > {} + {} NaN My question isn't why ({} + {}).toString() is "[object Object][object Object]" while NaN.toString() is "NaN" , this part has an answer here already . My question is why does this happen only on the client side? On the server side ( Node.js ) {} + {} is "[object Object][object Object]" . > {} + {} '[object Object][object Object]' Summarizing : On the client side: [] + [] // Returns "" [] + {} // Returns "[object Object]" {} + [] // Returns 0 {} + {} // Returns NaN NaN.toString()