HELP PLEASE: The highest random number that can be generated by randomRange should be equal to your maximum number, myMax

HELP PLEASE: The highest random number that can be generated by randomRange should be equal to your maximum number, myMax
0

#1
// Example
function ourRandomRange(ourMin, ourMax) {

  return Math.floor(Math.random() * (ourMax - ourMin + 1)) + ourMin;
}

ourRandomRange(1, 9);

// Only change code below this line.

function randomRange(myMin, myMax) {

  return Math.floor(Math.random() * (myMax - myMin)) + myMin;
   // Change this line

}

// Change these values to test your function
var myRandom = randomRange(5, 15);

https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/generate-random-whole-numbers-within-a-range


#2

Please include the link to the challenge if you’re coming from there for help.


#3

Currently, your randomRange function only goes up to one less than myMax. Try adding 1 to the part which gets multiplied by Math.random().


#4

alriht !!! oh my yes that is right… thanks so much God bless you it passed.

return Math.floor(Math.random() * (myMax - myMin + 1)) + myMin;


#5

Don’t post your working solution please. If you do, wrap it spoiler tags.
ie:
[spoiler]
your code
[/spoiler]


#6

I am sorry… about that… my bad… thanks for reminding me please.


#7

Spoiler tags go outside the code tags, to clarify. Your code still shows clearly.


#8

thanks… for the help. i am grateful.