Skip to content

Instantly share code, notes, and snippets.

@AaronFlower
Created January 15, 2019 03:16
Show Gist options
  • Save AaronFlower/14a332f1eae83c54c0f6b5cabfca3566 to your computer and use it in GitHub Desktop.
Save AaronFlower/14a332f1eae83c54c0f6b5cabfca3566 to your computer and use it in GitHub Desktop.
In JS, To check a value is an integer polyfill.
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