Skip to content

Commit b0a3afc

Browse files
committed
amend
1 parent 42da013 commit b0a3afc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +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 mean
88
// It will help to think about the order in which expressions are evaluated
99

10-
// Try logging the value of num and running the program several times to build an idea of what the program is doing
11-
num reprents the number is randomly generated whole number betweeb 1 and 100,inclusive
12-
Math.random() returns a random decimal between 0(inclusive) and 1(exclusive). while maximum-minimum +1=100, Math.random()*(maximum-matchMedia+1)
10+
// Try logging the value of num and running the program several times to build an idea of what the program is doingnum reprents the number is randomly generated whole number betweeb 1 and 100,inclusive
11+
Math.random() returns a random decimal between 0(inclusive) and 1(exclusive). while maximum-minimum +1=100, Math.random()*(maximum-minimum+1)
1312
range is between 0 and 99.99999
1413
Due to that Math.floor(...) rounds down the decimal to the nearest whole number.From this Stage, we have interger between o and 99.
1514
After + minimum, the range is between 1 and 100.

0 commit comments

Comments
 (0)