Skip to content

Commit 95fff67

Browse files
authored
Merge pull request #302 from MoisesTR/doc_continue_break
Add exercise questions for continue & break
2 parents 91c835e + 635e159 commit 95fff67

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
```

0 commit comments

Comments
 (0)