+ 1
In JavaScript, which value is not equal to itself, when we compare them??
Value types
4 Answers
+ 1
NaN is not equal to itself
console.log(NaN == NaN);
// false
console.log(NaN === NaN);
// false
console.log(NaN != NaN);
// true
0
Depends on definition of equality, right? :)
0
NaN is not equal to itself in most languages.
0
[0] == [0] returns false
[0] === [0] returns false
[0,0] == [0,0] returns false
[0,0] === [0,0] returns false
[0,x] == [0, x] (where x is seemingly any integer) returns false
[0,x] === [0, x] (where x is seemingly any integer) returns false
I hope this helped!