Commence countdown to frontpage submission "Float is a monad". I agree with your justification for 5 + NaN evaluating to NaN, but it would be even more useful if NaN == x (and every other operation on NaN) would evaluate to NaN as well. That's obviously not possible in statically typed languages, but it is in JS.
Actually, it is more idiomatic to use undefined for this purpose rather than NaN...
var determineLater; // undefined
var blah = 5;
blah += determineLater; // blah is now NaNFor the record, isNaN in JavaScript is also not necessarily the fastest way of doing it: http://jsperf.com/nantest
Which will absolutely not matter in 100% of the cases after rounding. `isNaN` is simple (your original criteria) and clearly says what it's doing.
The paper "What Every Computer Scientist Should Know About Floating Point Arithmetic" is a good guide to the details.
While we're on the topic of NaN, I'd like to mention a lesson from my little book of JavaScript you should never do[1]: You should never use null in JavaScript for the value of a yet-to-determine number. Always use NaN.
Why? It will be easier to detect problems:
blah is now NaN because (5 + NaN) is NaN. We want this because we want to know if there's been some kind of error in the making of blahBetter:
blah is now 5 because (5 + null) is 5. We do not want this because it doesn't let us know that there's been an error (the error typically being that determineLater was - incorrectly - never determined!)[1] not a real book, just a text file of mis-use cases.