Obsidian adds Number.isNumber()
function
Number.isNumber(NaN)
returns true
, which seems misleading
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 valueNaN
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.