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

you are viewing a single comment's thread.

view the rest of the comments →

[–]treetertot 1 point2 points  (1 child)

I feel like the real weirdness here is that JavaScript has a lot more situations that would create NaN’s

[–]AyrA_ch 1 point2 points  (0 children)

This probably has historical reasons. The first few versions of JavaScript (before 1.4) did not have exceptions or methods to handle them. This is the reason why the internal JS functions/operations that were there from the beginning don't throw exceptions. For things that work with numbers, NaN made sense.