This is somehow written in the same article :
This is also not the same as according to the === operator. The === operator (and the == operator) also considers the numeric values ββ-0 and +0 equal, and treats Number.NaN as not equal to NaN .
The logic is that NaN !== NaN is the only case when the !== operator returns true on the same variable, so it should be about NaN . Then it performs the same check on v2 and returns true for false based on the result: if v2 comparison is true , then about NaN compared to NaN they return true , if not, then return false , because NaN never matches what is not NaN.
gpgekko
source share