1function randomRange(min, max) {
2
3 return Math.floor(Math.random() * (max - min + 1)) + min;
4
5}
6
7console.log(randomRange(1,9));
1var myMin = 1;
2var myMax = 10;
3function randomRange(myMin, myMax) {
4 return Math.floor(Math.random() * (myMax - myMin + 1)) + myMin;
5}
6
7console.log(randomRange(myMin, myMax));
1function roundWholeNum(){
2
3
4return Math.floor(Math.random() * 20);
5}
6
7console.log(roundWholeNum());