Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript generate a random integer number in a range of numbers

const min = 1;
const max = 4;
const intNumber = Math.floor(Math.random() * (max - min)) + min;
console.log(intNumber); //> 1, 2, 3
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #javascript #generate #random #integer #number #range #numbers
ADD COMMENT
Topic
Name
5+7 =