Skip to content

Commit bae8316

Browse files
committed
modified: Sprint-1/1-key-exercises/1-count.js
Answered question about the assignment and also tested the code by logging the count variable to console
1 parent 8f3d6cf commit bae8316

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
let count = 0;
22

3-
count = count + 1;
3+
count = count + 3;
44

55
// Line 1 is a variable declaration, creating the count variable with an initial value of 0
66
// Describe what line 3 is doing, in particular focus on what = is doing
7+
8+
// Line 3 is updating the value of the count variable by adding 1 to its current value. The = operator
9+
// is used to assign the new value (count + 1) back to the count variable.
10+
// we can also say that the = operator is taking the value on the right side (count + 1) and storing it
11+
// in the variable on the left side (count).
12+
13+
// We can see the result of our code by logging the count variable to the console
14+
console.log(count);

0 commit comments

Comments
 (0)