Last Updated : 23 Jul, 2025
The JavaScript isNaN() Function is used to check whether a given value is an illegal number or not. It returns true if the value is a NaN else returns false. It is different from the Number.isNaN() Method.
Syntax:
isNaN( value )
Parameter Values: This method accepts a single parameter as mentioned above and described below:
Return Value: It returns a Boolean value i.e. returns true if the value is NaN else returns false.
Example: In this example, we will check various values for isNan() and the output will be in boolean format.
JavaScript
<script>
console.log(isNaN(12));
console.log(isNaN(0 / 0));
console.log(isNaN(12.3));
console.log(isNaN("Geeks"));
console.log(isNaN("13/12/2020"));
console.log(isNaN(-46));
console.log(isNaN(NaN));
</script>
Output:
false true false true true false true
We have a complete list of Javascript Function methods, to check those please go through this Javascript Function Complete reference article.
Supported Browsers:
We have a Cheat Sheet on Javascript where we covered all the important topics of Javascript to check those please go through Javascript Cheat Sheet-A Basic guide to JavaScript.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4