Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

math random js

function getRandomIntInclusive(min, max) {
  min = Math.ceil(min);
  max = Math.floor(max);
  return Math.floor(Math.random() * (max - min + 1)) + min; // max & min both included 
}
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #math #random #js
ADD COMMENT
Topic
Name
2+3 =