Last active
February 18, 2017 18:01
-
-
Save theswedishdev/3167ab515da0b90f0702bedaca9a9b46 to your computer and use it in GitHub Desktop.
JavaScript Number methods
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
Number.prototype.isInteger = function() { | |
return this % 1 === 0; | |
}; | |
Number.prototype.isFloat = function() { | |
return this % 1 !== 0; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment