Last active
February 23, 2017 10:45
-
-
Save nguyenbathanh/673319c04df6b615d557bec503f54ca2 to your computer and use it in GitHub Desktop.
Javascript check input is integer or not.
This file contains hidden or 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 isInt(value) { | |
| return !isNaN(value) && (function(x) { return (x | 0) === x; })(parseFloat(value)) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment