Global.NaN

JavaScript 1.3+, JScript 1.0+ Nav4.06+, IE 3+ Syntax

NaN

Description

The NaN object represents an object that is not equal to any number, including itself. NaN stands for Not a Number.

Example

Listing 6.139 shows how the NaN object is used in a comparison.

Listing 6.139 Example Using the NaN Object
<html>
<body>
<script lanuguage="JavaScript">
<!–– Hide
if ("a" != NaN){
     document.write("This is not a number");
}
// End Hide ––>
</script>

</body>
</html>
							
						

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.