Skip to content

Commit 973eda4

Browse files
committed
random.js task fixed
1 parent 5839e8d commit 973eda4

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

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

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

77

8-
// num variable that carries the result of the expressions evaluated.
9-
// (maximum - minimum) does basic math: 100 - 1 + 1 = 100
10-
// Math.floor() takes out all decimal and make them an integer.
11-
// Math.random() gives random numbers between 0 and 100.
12-
// + minimum add 1 at the end but randomise to the value between 0 and 100
8+
// "num" variable carries the result/value of the expressions evaluated.
9+
// (maximum - minimum) workout the size of the range: 100 - 1 + 1 = 100
10+
// Math.floor() takes out all decimal and make them a whole number from 0 to 99.
11+
// Math.random() gives a decimal from 0 up to just under 1 (0.9999999).
12+
// + minimum add 1 to the expression at the end because it is decleared a variable.

0 commit comments

Comments
 (0)