File tree 1 file changed +28
-0
lines changed
docs/Exercise/JavaScript_Basics
1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ ### Continue Exercise
2
+ 1 . ** Sets** a variable before the loop starts (var i = 0).
3
+ 2 . ** Make** the loop continue when i is 2 and 7
4
+ 3 . ** Sum** after the condition of the continue, add the value of the "i" into a
5
+ accumulator variable called sum
6
+ 4 . ** Print** the final value of var sum
7
+
8
+ ** Expected Output** :
9
+ 19
10
+
11
+ Reference loop
12
+ ``` js
13
+ for (var i = 0 ; i <= 7 ; i++ ) {}
14
+ ```
15
+
16
+ ### Break Exercise
17
+ 1. ** Sets** a variable before the loop starts (var i = 0 ).
18
+ 2. ** Sum** before the condition of the break , add the value of the " i" into a accumulator variable called sum
19
+ 3. ** Make** the loop break when i is 3
20
+ 4. ** Print** the final value of var sum
21
+
22
+ ** Expected Output** :
23
+ 6
24
+
25
+ Reference loop
26
+ ` ` ` js
27
+ for (var i = 0; i <= 7; i++) {}
28
+ ` ` `
You can’t perform that action at this time.
0 commit comments