Created
January 15, 2019 03:16
-
-
Save AaronFlower/14a332f1eae83c54c0f6b5cabfca3566 to your computer and use it in GitHub Desktop.
In JS, To check a value is an integer polyfill.
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.isInteger = Number.isInteger || function (n) { | |
return typeof n === 'number' && isFinite(n) && Math.floor(n) === n | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment