Skip to content

Commit 998a7ee

Browse files
comment and study exercise sprint-1/4-random.js
1 parent 006df3d commit 998a7ee

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,11 @@ const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
55

66
// 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
8+
9+
//Math.random() -> generates zero base random number
10+
// we need to multiply with digit number needed to allow possible number generated
11+
//Math.floor() method will round up to the base integer generated
12+
813
// It will help to think about the order in which expressions are evaluated
914
// Try logging the value of num and running the program several times to build an idea of what the program is doing
15+
console.log(num);

0 commit comments

Comments
 (0)