File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,7 +3,9 @@ const maximum = 100;
33
44const num = Math . floor ( Math . random ( ) * ( maximum - minimum + 1 ) ) + minimum ;
55
6- // In this exercise, you will need to work out what num represents?
6+ // In this exercise, you will need to work out what num represents?It gives us a random number between 1-100
77// Try breaking down the expression and using documentation to explain what it means
8+ //Math.random gives us a random number between 0-1 and the next parantecec returns 100
9+ //after that we multiple these two given values between 0-100 and the floor methode rounds down the given value
810// It will help to think about the order in which expressions are evaluated
911// Try logging the value of num and running the program several times to build an idea of what the program is doing
You can’t perform that action at this time.
0 commit comments