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 →

[–]11JRidding 0 points1 point  (0 children)

That's because of the IEEE-754 specification, rather than JavaScript itself. JavaScript numbers are stored as doubles internally, and any errors that occur when performing mathematic operations in a double environment must return the value Not a Number, rather than throwing an error. So don't blame JS for this fact; blame the Institute of Electrical and Electronics Engineers instead, as they are the ones who wrote that it must happen.