Skip to content

Commit 36f340d

Browse files
author
russom
committed
Update answer
1 parent f0cd42a commit 36f340d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ 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-
// 1. num is a variable that stores the final result of the expression assigned to it.
11+
// 1. num is a variable that stores the final result of the expression assigned to it, which is a pseudo-random number.
12+
// num can be any number between minimum 1 and maximum 100.
1213
// 2. The Math.random() method returns a pseudo-random floating number between 0(inclusive) and 1(exclusive).
1314
// 3. The Math.floor() method round a decimal number down to a whole number.
1415
// 4. (maximum - minimum + 1) calculates how many possible whole numbers there are.

0 commit comments

Comments
 (0)