How to use NaN Property in JavaScript

This article describe about NaN Property in JavaScript.
  • 1975

NaN Property in JavaScript

This property work on the Not-a-Number value. and NaN property show that a value is not a legal number.

Note: Value is NaN value then use the isNaN() global function to see it.

Syntax

Number.NaN

Example

<!DOCTYPE html>

<html>

<body>

<script type="text/javascript">

    var days = 32;

    if (days < 1 || days > 31) {

        days = Number.NaN;

    }

    document.write(days);

</script>

</body>

</html>

 

Output

 

pic5.jpg

You may also want to read these related articles Click here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.