O'Reilly logo
  • Ahmed Elgendy thinks this is interesting:

When we divide 0/0 we get NaN, but I tried dividing 10/0 and got Infinity. Is that different from NaN?


A: Good find. The Infinity (or -Infinity) value in JavaScript represents all numbers (to get a little technical) that exceed the upper limit on computer floating point numbers, which is 1.7976931348623157E+10308 (or -1.7976931348623157E+10308 for -Infinity). The type of Infinity is number an...


Cover of Head First JavaScript Programming


What is the difference between NaN and infinity?