Skip to content

Instantly share code, notes, and snippets.

@pedenys
Last active February 9, 2025 11:55
Show Gist options
  • Save pedenys/76e09880d14a58e03405984c505d8b0a to your computer and use it in GitHub Desktop.
Save pedenys/76e09880d14a58e03405984c505d8b0a to your computer and use it in GitHub Desktop.
Whole number between x and y

Source : Shivam Arora

var randomNumberBetweenXandY = (x,y) => Math.floor(Math.random() * ((y-x)+1) + x);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment