How can I generate numbers between 7 to 10? So far all I've figured out is generating in a range from 0-10:
Math.floor(Math.random()*11)
How can I generate numbers between 7 to 10? So far all I've figured out is generating in a range from 0-10:
Math.floor(Math.random()*11)
function getRandom(min, max) {
return min + Math.floor(Math.random() * (max - min + 1));
}
for(var x = 0; x < 5; x++) {
console.log(getRandom(7, 10));
}