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

// 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

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

1 Like

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

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

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

1 Like

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

1 Like

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

1 Like

thanks… for the help. i am grateful.

1 Like