Skip to content

Commit d6ea3d3

Browse files
committed
unpacked expressions
1 parent edb729d commit d6ea3d3

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎Sprint-2/1-key-exercises/4-random.js‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,8 @@ 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-
console.log(num);
11-
10+
11+
console.log(num);
12+
13+
// num represents any randomly generated number between 1 and 100.
14+
// Math.random pulls a random decimal, Math.floor rounds down to nearest whole number, (maximum - minimum + 1) sets the range, adding the minimum of 1 at the end allows for the possibility of a random number being 100 instead of 99.

0 commit comments

Comments
 (0)