Skip to content

Instantly share code, notes, and snippets.

@munierujp
Last active February 24, 2021 11:25
Show Gist options
  • Save munierujp/97abcbc63815f4469f2ba4d013b7ed92 to your computer and use it in GitHub Desktop.
Save munierujp/97abcbc63815f4469f2ba4d013b7ed92 to your computer and use it in GitHub Desktop.
function getRandomNumber (
min: number,
max: number
): number {
min = Math.ceil(min)
max = Math.floor(max)
return Math.floor(Math.random() * (max - min)) + min
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment