Skip to content

Commit f5e4d38

Browse files
committed
Change 4-random.js file
1 parent 7069bdc commit f5e4d38

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ console.log(num);
2424
2525
* Step 3: Math.random() * (maximum - minimum + 1)
2626
27-
* This scales the random decimal to the range.
28-
* Example: If Math.random() returns 0.3728,
27+
* This augment the random decimal to fit the range.
28+
* Example: If Math.random() it returns 0.3728,
2929
* 0.3728 * 100 = 37.28
3030
3131
* Step 4: Math.floor(...)
@@ -35,15 +35,13 @@ console.log(num);
3535
3636
* Step 5: + minimum
3737
38-
* Because the range started from 0, we add minimum (which is 1) to shift it to the correct range.
38+
* Because the range started from 0, we add minimum (which is 1) to adjust to the correct range.
3939
4040
* Example: 37 + 1 = 38.
4141
4242
* So what does num represent?
43-
* num is a random integer between 1 and 100 (inclusive).
44-
* Every time you run the program, you’ll get a different number in that range.
45-
46-
* Running it several times — you’ll see numbers like 27, 99, 7, 100, etc.
43+
* num is a random integer between 1 (inclusive) and 100 (exclusive).
44+
* Every time the program runs, we get a different number in that range.
4745
4846
*/
4947

0 commit comments

Comments
 (0)