JavaScript-Garden icon indicating copy to clipboard operation
JavaScript-Garden copied to clipboard

Added "NaN is not NaN"

Open shreyas-a opened this issue 8 years ago • 1 comments

shreyas-a avatar Oct 09 '17 18:10 shreyas-a

Great start, but I think currently this isn't thorough enough to be helpful.

First - it could explain why NaN !== NaN: to avoid two nonsensical operations being equal to each other, e.g if(Math.log(-1) === parseInt("%")) { doBadThing() }. Secondly it could mention the isNaN() function, which is the correct way to check for NaN.

timruffles avatar Oct 10 '17 09:10 timruffles