Skip to content

Commit fbabe03

Browse files
committed
Explanation of incrementing a variables
1 parent 127829d commit fbabe03

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎Sprint-2/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+
// ANSWER
9+
// In line 3, the value of 1 is added to the inital value of count which was 0, therefore the count value is being increasing by one each time the code runs and saves the new result into the count variable. The assignment operator "=" runs the everuthing on the right side and then store the result in the variable on the left hand side.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit d28242a938d2c22e3cfcc74476e48046bed8a348

0 commit comments

Comments
 (0)