Published Mar 15 2019
NaN
is a special case. A number is NaN
only if itβs NaN
or if itβs a division of 0 by 0 expression, which returns NaN
. In all the other cases, we can pass it what we want but it will return false
:
Number.isNaN(NaN) //true
Number.isNaN(0 / 0) //true
Number.isNaN(1) //false
Number.isNaN('Flavio') //false
Number.isNaN(true) //false
Number.isNaN({}) //false
Number.isNaN([1, 2, 3]) //false
I wrote an entire book on this topic π
I also got a super cool course π
© 2023 Flavio Copes
using
Notion to Site.
Follow on Twitter
Solopreneur? Wannabe? Adventure awaits