The Number isNaN() method
New Courses Coming Soon
Join the waiting lists
Find out all about the JavaScript isNaN() method of the Number object
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
→ Get my JavaScript Beginner's Handbook
→ Read my
JavaScript Tutorials
on The Valley of Code
→ Read my
TypeScript Tutorial
on The Valley of Code
Here is how can I help you:
- COURSES where I teach everything I know
- CODING BOOTCAMP cohort course - next edition in 2025
- BOOKS 16 coding ebooks you can download for free on JS Python C PHP and lots more
- Follow me on X