Created
November 22, 2016 11:09
-
-
Save u01jmg3/ea38e4e8930b552e6a928d11436ef985 to your computer and use it in GitHub Desktop.
JavaScript equivalent of PHP's `is_numeric()`
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 isNumeric(n) { | |
return !isNaN(parseFloat(n)) && isFinite(n); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment