Hi, I can’t understand why my solution doesn’t pass this test: " randomRange should use both myMax and myMin , and return a random number in your range."
Here is what I wrote and it seems to work just fine:
function randomRange(myMin, myMax) {
// Only change code below this line
return Math.round(Math.random() * (myMax - myMin) + myMin);
// Only change code above this line
}
I found the reason already, unfortunately it doesn’t accept solution with Math.round and we have to use Math.floor with that formula @hbar1st wrote about.
Thanks for your support anyways and sorry for not clarifying that I don’t need help anymore…