4 ms·
> [5] + [5] "55" This is why people don't like JavaScript.
by nilved 13y ago
> [5] + [5]
"55"
This is why people don't like JavaScript.
- tg3 13y agoWhat would you expect the behavior to be there? [5, 5]? I know that JS has its quirks (to say it nicely), but once you understand it (type coercion, equality, scoping, etc) it doesn't seem to be a huge burden to me.
- nilved 13y agoYes. That's the behaviour in Python, Ruby and just about every other language with overloaded operators.