File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,3 +7,9 @@ const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
77// Try breaking down the expression and using documentation to explain what it means
88// It will help to think about the order in which expressions are evaluated
99// Try logging the value of num and running the program several times to build an idea of what the program is doing
10+
11+ // This code generates a random number between 1 and 100 (inclusive of 100).
12+ // Math.random() produces a pseudo-random number greater than or equal to 0 and less than 1.
13+ // That number is multiplied by the total count of possible values we want, in this case 100.
14+ // The + 1 in (maximum - minimum + 1) ensures that 100 is one of the possible values of num.
15+ // the + minimum at the end makes 1 the lowest value possible.
You can’t perform that action at this time.
0 commit comments