loading...

re: What is the oddest JavaScript behavior? VIEW POST

FULL DISCUSSION
 

I find these very funny:

typeof(1 + '1') // returns a string because + is overloaded to concatenate

typeof(1 * '1') // but not *

"1" -- "1" // returns 2

"1" - "1" // returns 0

Code of Conduct Report abuse