Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

random number generator

// Javascript
function getRandomInt(max) {
  return Math.floor(Math.random() * max);
}

console.log(getRandomInt(10)); // Integer values: [0, 9]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #random #number #generator
ADD COMMENT
Topic
Name
9+2 =