Answers for "generate random whole numbers within a range"

1

Generate random whole numbers within a range javascript

function randomRange(min, max) {

	return Math.floor(Math.random() * (max - min + 1)) + min;

}

console.log(randomRange(1,9));
Posted by: Guest on January-02-2021
0

generate random whole numbers within a range

var myMin = 1;
var myMax = 10;
function randomRange(myMin, myMax) {
  return Math.floor(Math.random() * (myMax - myMin + 1)) + myMin;
}

console.log(randomRange(myMin, myMax));
Posted by: Guest on December-25-2020
0

generate random whole numbers within a range

function roundWholeNum(){


return Math.floor(Math.random() * 20);
}

console.log(roundWholeNum());
Posted by: Guest on July-02-2021

Code answers related to "generate random whole numbers within a range"

Browse Popular Code Answers by Language