isNaN() Function in JavaScript

isNaN() Function in JavaScript
Rating: 5 - 1 Votes

isNaN() Function in JavaScript

JavaScriptNaN stands for not a number in JavaScript.  Floats and integers are basically numbers.  IsNaN() function checks whether the value is number or not.  It will return true or false. This function will be helpful in case you want to avoid users from passing any value other than a number.   Example is given below where we are making use of isNaN() function to detect illegal values before addition.