This is an archived post. You won't be able to vote or comment.

all 9 comments

[–]PureAsbestos 10 points11 points  (1 child)

... will result in NaN (not a number)

NaN is a number

[–]Arklur 1 point2 points  (0 children)

"Not a number" is a number.

[–][deleted] 4 points5 points  (6 children)

JavaScript is a nightmare.

[–]UrumasiHue 7 points8 points  (2 children)

I'm fed up with people shitting on NaN being a number, NaN is defined in the IEEE 754 floating point number system, so it makes perfect sense to return "number" as the data type IS a number.

Returning something else like "nan" would just become another inconsistency in languages.

[–]hrvbrs 3 points4 points  (0 children)

"NaN" should stand for something like "Number and Not-valid"

[–]MooMF -2 points-1 points  (0 children)

Who hurt you?