My code gives me the correct answer but doesnt complete the challenge. The following criteria is incomplete;
You should have multiplied the result of Math.random by 10 to make it a number that is between zero and nine.
Can anyone figure out what’s wrong with solving the problem this way? Thanks in advance x
Your code so far
var randomNumberBetween0and19 = Math.floor(Math.random() * 20);
function randomWholeNum() {
// Only change code below this line.
var a = Math.random();
var b = a* 10;
var c = Math.floor(b);
return c;
}
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36
.
Link to the challenge: