607
Javascript can create atomic bombs
(programming.dev)
Post funny things about programming here! (Or just rant about your favourite programming language.)
It seems it is that way, which is weird. You should always convert to the widest type, meaning string for comparing numbers and strings. I just checked that
1 == "01"
istrue
, which means that "01" gets cast to an integer. And according to the document it might be that for example1 == "a"
would basically be interpreted as1 === NaN
which isfalse
.