Skip to content

Commit 9b83b30

Browse files
committed
docs(key-exercises): explain variable reassignment in 1-count.js
Describe how the assignment operator evaluates the right-hand side expression before assigning the result to the count variable
1 parent 8f3d6cf commit 9b83b30

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ 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 reassigns the count variable by evaluating the expression on the right hand side of the assignment.
9+
// The right hand side (count + 1) is evaluated first, then the = operator assigns that value to count.

0 commit comments

Comments
 (0)