Skip to content

Commit c4aa428

Browse files
committed
explain the expression in order of mathematical operation
1 parent c308f99 commit c4aa428

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ const maximum = 100;
33

44
const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
55

6-
// In this exercise, you will need to work out what num represents?
7-
// Try breaking down the expression and using documentation to explain what it means
8-
// It will help to think about the order in which expressions are evaluated
6+
//num represents a number
7+
//lets start by (maximum-minimum +1) which the output is 100.
8+
//math.random()*100 returns random number between 0 and 100
9+
//math.floor()it rounds a number to thier nearest integer,
10+
//at the end we add 1.
11+
912
// Try logging the value of num and running the program several times to build an idea of what the program is doing

0 commit comments

Comments
 (0)