Skip to content

Commit db7e9d1

Browse files
complete count and random exercise
1 parent e3fd82b commit db7e9d1

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
let count = 0;
2-
console.log(count);
32

43
count = 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.

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ const minimum = 1;
22
const maximum = 100;
33

44
const 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.

0 commit comments

Comments
 (0)