Tell us what’s happening:
I don’t really want to move forward here without fully understanding what’s happening. I know the first ‘+1’ is to avoid the zero index, but why the ‘+ min’ at the end?
Your code so far
function randomRange(myMin, myMax) {
Math.floor(Math.random() * (myMax - myMin + 1)) + myMin;
// Only change code below this line
return 0;
// Only change code above this line
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36 Edg/106.0.1370.47
Challenge: Basic JavaScript - Generate Random Whole Numbers within a Range
Link to the challenge: