3 ms·
I think it should be an exception as those types can not be concatenated. But still , "" + null being "null" is just plain crazy. I could see "" + null == "" (
by fgonzag 10y ago
I think it should be an exception as those types can not be concatenated.
But still , "" + null being "null" is just plain crazy. I could see "" + null == "" (as you are concatenating nothing to the string), or "" + null == null as you are concatenating a string to null, but "null" is bonkers.
- tantalor 10y agoThis is why I shrug when people complain about JavaScript casting weirdnesses