Earlier quoted context omitted.
So it's Not-a-Number but isNumber returns true? That would imply then that isNumber is named incorrectly. So perhaps isNumber should read isNumericType? Most of the time I want to test, is this a number I can use in a normal mathematical sense. As in, can I use it in subtraction, multiplication etc. I know now that I should use isFinite and isNumber, but wouldn't it be nice to have just one well named function for th…
It's consistent with the names of other type-checking functions. isNumber checks if a value is an instance of the Number class just like isDate checks if a value is an instance of the Date class. If it were isNumericType, they'd get questions about why the function doesn't follow the existing naming convention. The only reason this is confusing for people is because they aren't familiar with IEEE 754 floating-point n…
Its confusing because NaN explicitly states not a number. Then the function explicitly states is number.
However the two are in very different contexts, yet this is not communicated when using them. It's intuitive to think of a date as a class and there for the context is implicit in isDate. I don't think this is the case for isNumber.
I think this is less about people understanding floating-point numbers more about understanding that a function starting with is implies some form of type checking.