Answers for "how to print a whole number using random in javascript"

37

javascript get random number in range

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

//usage example: getRandomNumberBetween(20,400);
Posted by: Guest on July-23-2019
0

Generate random whole numbers javascript

var randomWholeNumber = Math.floor(Math.random() * 20);


function randomWholeNum() {

	return Math.floor(Math.random() * 10);

}

console.log(randomWholeNum());
Posted by: Guest on January-02-2021

Code answers related to "how to print a whole number using random in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language