News for hackers. Stuff that matters.
Re:Shipping Culture Is Hurting Us by pcl on Tuesday February 17, 2015 @01:34AM (#9060954)
In practice, NaN as a literal means that the outcome of a mathematical statement is not expressible. So, the letter 'a' is not equal to NaN (with either two or three = signs). NaN, in other words, has a special meaning.

Dismayingly, JavaScript's isNaN() function diverges from this special meaning, and does something close to what you said -- it tests to see if something is at least almost a number. So isNaN(13/0) and isNaN('foo') both evaluate to 'true', whereas isNaN('1') and isNaN(42) both evaluate to 'false'.

Re:Shipping Culture Is Hurting Us by flomo on Tuesday February 17, 2015 @05:15AM (#9061460)
Javascript type coercions might make sense if you realize it was originally designed for a close integration with HTML forms using a simplified proto-DOM ("Level 0").

The idea was more like "isNaN(myForm.myField)"?

For all I know, the above might actually still work. But either way, that explains Javascript type conversion logic.