Created
October 30, 2013 23:16
-
-
Save aswebdev/b0138dbd15fd2cca5aac to your computer and use it in GitHub Desktop.
JavaScript integer validation function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isNumber(n) { | |
// Determine if numeric (whole number or float) | |
return !isNaN(parseFloat(n)) && isFinite(n); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment