|
|
|
|
|
by michaelmartin
4101 days ago
|
|
It's the inconsistency. 1 + "2" (12) does a string concatenation.
1 - "2" (-1) does math. That said, whilst JS is loosely typed and won't fall over when you do this, I'd just see it as bad form to find code mixing types to this extent. Just because the language will let you do it, doesn't mean you should actually do it! |
|