isNaN is very useful method in javascript to validate the input is a valid number or not. It's return the bool value. if value is number then it will return "false" otherwise it will return "true".
One more thing you have to keep in mind that this function will return "false" if you are passing blank/empty value to this function. to overcome this problem always use parseInt method.
isNaN(parseInt("Enter the value"))
One more thing you have to keep in mind that this function will return "false" if you are passing blank/empty value to this function. to overcome this problem always use parseInt method.
isNaN(parseInt("Enter the value"))
No comments:
Post a Comment