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.
Syntax:
The syntax of NaN is −
var val = Number.NaN;
Example:
The following example shows how to use NaN.
Output:
Day of Month must be between 1 and 31.
|
|
Javascript Objects Related Tutorials |
|
---|---|
CSS3 Tutorial | HTML 5 Tutorial |
PHP Tutorial | AJAX Tutorial |
CSS Advanced Tutorial | Javascript Advanced Tutorial |
CakePHP Tutorial | CodeIgniter Tutorial |
JSON (JavaScript Object Notation) Tutorial |
Javascript Objects Related Interview Questions |
|
---|---|
CSS3 Interview Questions | HTML 5 Interview Questions |
PHP Interview Questions | AJAX Interview Questions |
CSS Advanced Interview Questions | Java Abstraction Interview Questions |
Javascript Objects Interview Questions | Javascript Advanced Interview Questions |
CakePHP Interview Questions | CodeIgniter Interview Questions |
JSON (JavaScript Object Notation) Interview Questions | Advanced jQuery Interview Questions |
All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.