We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8aeec63 commit f711afcCopy full SHA for f711afc
1 file changed
Sprint-1/1-key-exercises/1-count.js
@@ -1,9 +1,7 @@
1
let count = 0;
2
3
-count = count + 1;
+count = count + 1; // increment: adds 1 and assigns the new value back
4
5
-// Line 1 is a variable declaration, creating the count variable with an initial value of 0
6
-// Describe what line 3 is doing, in particular focus on what = is doing
7
-
8
-// The = operator assigns a new value to 'count'. It takes the current value of 'count'.
9
-// adds 1 to it, and then stores that new value back into the 'count' variable.
+// MDN Increment operator: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Increment
+// MDN Assignment operators: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators#Assignment_operators
+// Alternatives: count += 1 or count++
0 commit comments