Skip to content

Commit d2e9c84

Browse files
committed
Finished exercise 4
1 parent f124dc3 commit d2e9c84

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ const maximum = 100;
33

44
const 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
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
9+
// Answer: num choose a random number between 0 and 100 and adds 1 to it so that the number is between 1 and 100 instead of 0 and 99
10+
911
// Try logging the value of num and running the program several times to build an idea of what the program is doing
12+
console.log(num);

0 commit comments

Comments
 (0)