Skip to content

Instantly share code, notes, and snippets.

@rvighne
Created September 11, 2016 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rvighne/d43bd1b7b8d9f37df526994e93fa6a99 to your computer and use it in GitHub Desktop.
Save rvighne/d43bd1b7b8d9f37df526994e93fa6a99 to your computer and use it in GitHub Desktop.
Get a random integer in the widest possible range of positive integers.
function randInt() {
return Math.trunc(Math.random() * Number.MAX_SAFE_INTEGER);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment