Skip to content

Instantly share code, notes, and snippets.

@AbreuY
Created January 12, 2022 22:07
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 AbreuY/d6b9883c6e1fefbd19e6b1166e502a0e to your computer and use it in GitHub Desktop.
Save AbreuY/d6b9883c6e1fefbd19e6b1166e502a0e to your computer and use it in GitHub Desktop.
Generate a random number from given numbers. min and max.
function randomNumber(min, max)
{
let result;
result = Math.floor(Math.random() * (max - min + 1)) + min;
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment