Tell us what’s happening:
I broke up the code into more steps to be able to see what I was doing, but my compiler says that I need to multiply by 10 to get a whole number. How is
var randomNum = Math.random() * 10;
differnet from
var randomNum = Math.random();
randomNum *= 10;
**Your code so far**
function randomWholeNum() {
// Only change code below this line
var randomNum = Math.random();
randomNum *= 10;
var wholeNum = Math.floor(randomNum);
return wholeNum;
}
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36
Challenge: Basic JavaScript - Generate Random Whole Numbers with JavaScript
Link to the challenge:
