No, that’s Number.isNaN. The global isNaN, which I used in the post, converts the supplied value to a number if it isn’t already, but it has such odd rules for doing so that the Mozilla web docs have an entire section talking about it.
(Also, “equivalent to NaN" is an odd phrase to use in this context; in JavaScript, NaN != NaN.)
isNaNreturns true if the provided object is a Number, and equivalent toNaN.No, that’s
Number.isNaN. The globalisNaN, which I used in the post, converts the supplied value to a number if it isn’t already, but it has such odd rules for doing so that the Mozilla web docs have an entire section talking about it.(Also, “equivalent to
NaN" is an odd phrase to use in this context; in JavaScript,NaN != NaN.)