15

That NaN is considered a number in JS.

Half a day I spent figuring out what went wrong.

Comments
  • 1
    Not a number is a number!? 😱😱
  • 2
    That's JS. Cobbled together by a kid with a bottle of crazy glue.
  • 0
    NaN is More like the null value for numbers than an object of another type...
  • 3
    Yes, from a typesystem point of view, NaN is a number. It's a special numeric value to show that the value can't be represented. For the same reason, null's type is object, even though it represents that there is no object.
  • 0
    That's why JS has a function called isNaN(value)
Add Comment