7.2.16 Strict Equality Comparison
The comparison x === y, where x and y are values, produces true or false. Such a comparison is performed as follows:
If Type(x) is different from Type(y), return false.
If Type(x) is Number or BigInt, then
a. Return ! Type(x)::equal(x, y).
Return ! SameValueNonNumeric(x, y).
Now, what this means is that some things with the same identity compare false with ===, and some things with different identities compare true with ===.
e.g.
NaN === NaN is false
-0 === 0 is true
Which means that it is not checking the identity of the operands -- it is computing a kind of equality (using the strict equality comparison).
So, === is not an identity operator, and for these reasons is not called an identity operator in the language specification.
It's just some confused people on the internet who are making that into a popular mistake. :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The page you've referenced is mostly correct, but they're a bit confused on terminology, and have made things rather more complicated that necessary.
See: ecma-international.org/publication...
Now, what this means is that some things with the same identity compare false with ===, and some things with different identities compare true with ===.
e.g.
NaN === NaN is false
-0 === 0 is true
Which means that it is not checking the identity of the operands -- it is computing a kind of equality (using the strict equality comparison).
So, === is not an identity operator, and for these reasons is not called an identity operator in the language specification.
It's just some confused people on the internet who are making that into a popular mistake. :)