10
Bikonja
8y

According to Javascript, null is a number.

Comments
  • 3
    also, "NaN" is not a number
  • 1
    @asgs well, NaN is short for Not a Number so that's in the name...
  • 1
    @Bikonja Err, I was trying to be funny, but failed miserably
  • 2
    @asgs well you're either funny for posting or for failing, it's a foolproof plan :D
  • 1
    But NaN is actually a valid floating point number in JS.

    #themoreyouknow
  • 2
    Also: null is an object according to JS.
    Try it: typeof null
  • 1
    @theZorgEffect even that makes some sense to me as a variable that holds an object can hold null to specify it's empty (a reference type), but numbers are value types and value types can not be null so null being a number makes no sense.
Add Comment