Just out of curiosity.
It doesn\'t seem very logical that typeof NaN is number. Just like NaN === NaN or NaN == NaN returning
typeof NaN
NaN === NaN
NaN == NaN
If using jQuery, I prefer isNumeric over checking the type:
isNumeric
console.log($.isNumeric(NaN)); // returns false console.log($.type(NaN)); // returns number
http://api.jquery.com/jQuery.isNumeric/