Skip to content

Commit 1b5ce16

Browse files
committed
Clarify the assignment operation in count.js
1 parent d28242a commit 1b5ce16

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎Sprint-2/1-key-exercises/1-count.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,9 @@ count = count + 1;
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 updated the value of the variable "count". The "=" operator is an
9+
assignment operator, which takes the value on the right side
10+
("count + 1") and assigns it to the variable on the left side
11+
("count"). So, it takes the current value of "count", adds 1 to it, and then
12+
stores that new value back into "count".

0 commit comments

Comments
 (0)