JavaScript Objects The Number Object- NaN - Javascript Objects

What is JavaScript Number – NaN?

Unquoted literal constant NaN represents Not-a-Number is a special value . Since NaN always compares unequal to any number, including NaN, it is normally used to indicate an error condition for a function which returns a valid number.

Note − Use the isNaN() global function to see if a value is an NaN value.


The syntax of NaN is −

var val = Number.NaN;


The following example shows how to use NaN.


Day of Month must be between 1 and 31.

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd Protection Status

Javascript Objects Topics