Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions docs/Exercise/JavaScript_Basics/continue_break.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
### Continue Exercise
1. **Sets** a variable before the loop starts (var i = 0).
2. **Make** the loop continue when i is 2 and 7
3. **Sum** after the condition of the continue, add the value of the "i" into a
accumulator variable called sum
4. **Print** the final value of var sum

**Expected Output**:
19

Reference loop
```js
for (var i = 0; i <= 7; i++) {}
```

### Break Exercise
1. **Sets** a variable before the loop starts (var i = 0).
2. **Sum** before the condition of the break, add the value of the "i" into a accumulator variable called sum
3. **Make** the loop break when i is 3
4. **Print** the final value of var sum

**Expected Output**:
6

Reference loop
```js
for (var i = 0; i <= 7; i++) {}
```