Skip to content

Commit c67e10a

Browse files
committed
Explain code exercise
1 parent 1a46297 commit c67e10a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,11 @@ 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+
// Math.floor() - rounds down to nearest integer
12+
// Math.random() - gives a random number
13+
// (max - min + 1) - 100
14+
// simple bodmas bro
15+
16+
// math.random = 2
17+
// num = 201

0 commit comments

Comments
 (0)