Skip to content

Commit 444c0fa

Browse files
committed
answered key exercise 4 (random).
1 parent 5f24463 commit 444c0fa

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,9 @@ const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
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
1010

11-
console.log(num)
11+
console.log(num)
12+
13+
math.floor is round down the number returns to largest integer less than or equal to a given number.
14+
math.random() could generate the number from 0 to <1 b random.
15+
maximum refer to 100 and minimum refer to 0.
16+
The calculation of num is different everytime because of math.random()

0 commit comments

Comments
 (0)