0
[] + {} = "[object Object]"
{} + [] = 0
[] + [] = ""
{} + {} = NaN

Who can explain me, why these operations give totally unexpected results? How does operator overloading is set for "+" in such kind of situations?

Placinta Alexandru
  • 463
  • 2
  • 7
  • 20

0 Answers0