I stack in these challenge even if i watched the video tutorials

Tell us what’s happening:

Your code so far


// 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 + 1))+mymin;
}

var myRandom = randomRange(5, 15);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/82.0.4068.4 Safari/537.36.

Challenge: Generate Random Whole Numbers within a Range

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

Hello @solWeb!

Take a closer look at your code.
At the beggining

you’re giving your parameters names myMin and myMax,but inside the function you used mymin and mymax,those are totally different variables from your parameters,and if you try to console.log(mymin,mymax) it will give you message that these variables are not defined.

Just make sure that you use the same named parameters inside the function.

Hope this helps :slight_smile:

1 Like