BUG: Number.isNumber(NaN)

Obsidian adds Number.isNumber() function

Number.isNumber(NaN) returns true, which seems misleading

Looking at this page javascript - Why does angular.isNumber(NaN) return true? - Stack Overflow perhaps has some explanations for this.

Although the value of NaN represents something that is not a number, the value NaN itself is still a number type (in the type system sense).

It’s also a defined value for a floating point number in IEEE 754, which is what JavaScript uses for numbers. It is sensible that values infinity and NaN would be number types.

Here is the opposite logic.

And Here

I guess there is no an industry standard?

1 Like