So i tried to get over it
But changing the last line to myMax doesn’t work but, i did set it to equal to. Then I tried myMin but, another failure again.
Your code so far
function randomRange(myMin, myMax) {
// Only change code below this line
return Math.floor(Math.random() * (myMin - myMax + 1) >= myMin);
// 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/80.0.3987.149 Safari/537.36.
Challenge: Generate Random Whole Numbers within a Range
Of course the texts ask me to: and is less than or equal to myMax , inclusive.
The >= meant less then or equal to.
and the myMax is what we needed to check.
But, when I entred that one it did’t work So I thought it might be JS way of reading things and needed to use minMax instead to compare it.
Yes the comparison operator doesn’t belong there. I think for the purpose of this exercise you can assume that myMax is always going to be greater than or equal to myMin.
As @sgedye says, for the purpose of this exercise assume myMax is ALWAYS greater than myMin.
Later, as real a developer, you’ll want to add in some validation code before just “always assuming”.