Skip to content

Commit 8833f3c

Browse files
committed
key-exercises folder completed
1 parent ecca7f7 commit 8833f3c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ const minimum = 1;
22
const maximum = 100;
33

44
const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
5+
//Math.floor is rounding down number from float number to integer
6+
//Math.random create a random decimal number(float) from 0 up to 1 we then multiply it by (100) and add 1(minimum)
7+
// variable num represents a random integer ranging from 1 to 100
8+
console.log(num);
59

610
// In this exercise, you will need to work out what num represents?
711
// Try breaking down the expression and using documentation to explain what it means

0 commit comments

Comments
 (0)