0

It's a known fact in Js that the value NaN is not equal to itself

console.log(NaN === NaN)
// false

Which other Javascript literal values are not equal to themselves - or is NaN the only value??

I've already checked and found that undefined, null, Infinity, -Infinity are all equal to each other.

Probosckie
  • 1,585
  • 4
  • 25
  • 40
  • 1
    NaN should be unique in this regard: [Relational Expressions](https://www.oreilly.com/library/view/javascript-the-definitive/9781449393854/ch04s09.html) – Emil S. Jørgensen Aug 21 '19 at 11:41
  • Just `NaN`. Check [this table](https://stackoverflow.com/a/23465314/3082296) – adiga Aug 21 '19 at 11:56
  • This is not really specific to JavaScript, the IEEE 754 floating-point standard requires it. https://en.wikipedia.org/wiki/NaN#Comparison_with_NaN – Felix Kling Aug 21 '19 at 11:57

0 Answers0