**Tell us what’s happening:**

so im learning javascript and reached this challenge, which requires me to generate a random whole number within a range(104th challenge). I use the formula in the example and passed the challenge. But then im wondering why not just use round function instead of floor function? so i wrote a new code with the round function to see if i’ll pass the challenge. As you can guess this code doesn’t work, i pass all the challenge requirement except the last one and i just can’t understand why this code doesn’t work.

-challenge requirement :

The lowest random number that can be generated by `randomRange`

should be equal to your minimum number, `myMin`

.

Passed

The highest random number that can be generated by `randomRange`

should be equal to your maximum number, `myMax`

.

Passed

The random number generated by `randomRange`

should be an integer, not a decimal.

Passed

`randomRange`

should use both `myMax`

and `myMin`

, and return a random number in your range.

**Your code so far**

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

**Your browser information:**

User Agent is: `Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36`

.

**Challenge:** Generate Random Whole Numbers within a Range

**Link to the challenge:**