File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11let count = 0 ;
2- console . log ( count ) ;
32
43count = count + 1 ;
54
6- console . log ( count ) ;
7-
85// Line 1 is a variable declaration, creating the count variable with an initial value of 0
96// Describe what line 3 is doing, in particular focus on what = is doing
7+
8+ // Line 3: Adds 1 to count and assigns the result back to count.
9+ // The = operator assigns the new value to count.
Original file line number Diff line number Diff line change @@ -2,9 +2,11 @@ const minimum = 1;
22const maximum = 100 ;
33
44const num = Math . floor ( Math . random ( ) * ( maximum - minimum + 1 ) ) + minimum ;
5- console . log ( Math . floor ( Math . random ( ) * ( maximum - minimum + 1 ) ) + minimum ) ;
5+
66
77// In this exercise, you will need to work out what num represents?
88// Try breaking down the expression and using documentation to explain what it means
99// It will help to think about the order in which expressions are evaluated
1010// Try logging the value of num and running the program several times to build an idea of what the program is doing
11+
12+ //num represents a random whole number between 1 and 100.
You can’t perform that action at this time.
0 commit comments