Skip to content

Commit 8a38be1

Browse files
authored
Clarify comments on random number generation
Updated comments to clarify the random number generation process.
1 parent 77da0b4 commit 8a38be1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const maximum = 100;
44
const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
55

66
// In this exercise, you will need to work out what num represents?It gives us a random number between 1-100
7-
// Try breaking down the expression and using documentation to explain what it means
7+
// Try breaking down the expression and using documentation to explain what it means? + minimum shifts it between 1-100 so the minimum number is 1 and the biggest one is 100
88
//Math.random gives us a random number between 0-1 and the next parantecec returns 100
99
//after that we multiple these two given values between 0-100 and the floor methode rounds down the given value
1010
// It will help to think about the order in which expressions are evaluated

0 commit comments

Comments
 (0)