Skip to content

Instantly share code, notes, and snippets.

@mohnatus
Created April 12, 2019 10:36
Show Gist options
  • Select an option

  • Save mohnatus/819ece9d5548fa673e3c1eecfe4c467e to your computer and use it in GitHub Desktop.

Select an option

Save mohnatus/819ece9d5548fa673e3c1eecfe4c467e to your computer and use it in GitHub Desktop.
get random integer
// Возвращает случайное целое число между min (включительно) и max (не включая max)
// Использование метода Math.round() даст вам неравномерное распределение!
function getRandomInt(min, 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