I have been writing JavaScript For A Long Time and want to figure out what Nan is? Is it a type? Or a convention?
Run typeof Nan directly in the browser // return "Number"
It indicates that Nan is a number, not a new type.
Then there is a question about how Nan represents in the memory?
Google found: "When an infinite number is too large to be expressed, Nan indicates an illegal operation or an undefinable result.
Where, infinity can be expressed as INF. The value in the memory is, the order code is full 1, and the ending number is all 0. Nan indicates that the order code is full 1 and the ending number is incomplete. "
That is to say, Nan is stored in the memory with "full level code 1 and incomplete tail number 0.
Of course, in addition to "Nan", there are also JavaScript and how infinity is expressed.
You only need to enter 1/0 in the browser to know what is returned.
1/0 // return infinity
Typeof infinity // return "Number"
It seems that "Nan" and "infinity" are the same principle.