Basic JavaScript - Generate Random Whole Numbers within a Range

Don’t understand this code
What does this code mean exactly? I cannot understand this code : ```
Math.floor(Math.random() * (max - min + 1)) + min


**Your code so far**


```javascript
function randomRange(myMin, myMax) {
  // Only change code below this line
  
  return   Math.floor(Math.round()* (myMax-myMin +1))-myMin
;
  // Only change code above this line
}

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:107.0) Gecko/20100101 Firefox/107.0

Challenge: Basic JavaScript - Generate Random Whole Numbers within a Range

Link to the challenge:

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

The (max - min +1)+min

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.