Skip to content

Commit 21eed1b

Browse files
Fix comments and add interval notation
1 parent 73c30ee commit 21eed1b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ const maximum = 100;
44
const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
55
console.log(num);
66
// In this exercise, you will need to work out what num represents?
7-
// num represents random whole number between 1 to 100
7+
// num represents random whole number in the interval [1,100]
88
//It is generated by:
9-
//Creating a random decimal between 0 and 1 using Math.random()
10-
//Scaling it to the range 1 to 100
9+
//Creating a random decimal in the interval[0'1)] using Math.random()
10+
//Scaling it to in the interval [1,100]
1111
//Rounding it down using Math.floor() so it becomes an integer
1212

1313
// Try breaking down the expression and using documentation to explain what it means

0 commit comments

Comments
 (0)