TIL: In JavaScript, isNaN("")
returns false, but parseInt("")
returns NaN. o_o
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
.)