Question and answer is powered by AnsPress.io
In Javascript, I want to check my return value is numeric or not. How can I check the numeric values in JavaScript?
If my value like:
console.log('100');
If is it possible to return true or false to check numeric values?
The isNaN() function determines whether the given value is a number or Not-a-Number. The function outputs as True for a NaN value and returns False for a valid numeric value.
Example:
console.log(isNaN('100')) console.log(isNaN('Demo'))
Output:
false
true