Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript random int in range

function randomInt(min, max) {
  return Math.floor(Math.random() * (max - min + 1) + min)
}

console.log(randomInt(1, 6)) // random integer between 1 and 6
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #random #int #range
ADD COMMENT
Topic
Name
5+1 =