|
|
|
|
|
by squeaky-clean
4177 days ago
|
|
There is no expected output. It doesn't make sense to subtract the value 1 from the string "wat". But Javascript will cast both of them to numbers, then try to subtract 1 from NaN. However, if you do "wat" + 1, Javascript will cast both of them to strings, and append "1" to "wat". It's not just the odd behavior, but the inconsistency. |
|
I like javascript but I don't do anything so complicated (or maybe not the right types of things) that I run into many of these situations.