First of all I want to mention that I know how isNaN()
and Number.isNaN()
work. I am reading The Definite Guide by David Flanagan and he g
For purposes of NaN, !=
and !==
do the same thing.
However, many programmers avoid ==
or !=
in JavaScript. For example, Douglas Crockford considers them among the "bad parts" of the JavaScript language because they behave in unexpected and confusing ways:
JavaScript has two sets of equality operators:
===
and!==
, and their evil twins==
and!=
. The good ones work the way you would expect....My advice is to never use the evil twins. Instead, always use
===
and!==
.