I am struggling to understand the output on the console when I check this answer. I am expecting to see random numbers between 1 and 6. However I see double digit numbers in the answer.
Your code so far
function randomRange(myMin, myMax) {
// Only change code below this line
console.log(Math.floor(Math.random() * (myMax - myMin + 1) + myMin));
// Only change code above this line
}
randomRange(1, 6);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36.
Challenge: Generate Random Whole Numbers within a Range
Its all the tests that fcc are running, so it will console.log for everytime the function has ran for example if you done this…
function randomRange(myMin, myMax) {
// Only change code below this line
console.log(myMax)
return 0;
// Only change code above this line
}
it will console.log a load of 15s because thats what all the ffc tests are using for their max number,
it shouldn’t be like this i dont think, i get how it would confuse people so i dont know why they do it like this, so if you ran this…
function randomRange(myMin, myMax) {
// Only change code below this line
console.log(myMax)
return 0;
// Only change code above this line
}
randomRange(3, 60)
It will be 60 at the top which is what your testing, then followed by a load of 15s which fcc is testing.