diff --git a/docs/Exercise/JavaScript_Basics/continue_break.md b/docs/Exercise/JavaScript_Basics/continue_break.md new file mode 100644 index 0000000..b169f43 --- /dev/null +++ b/docs/Exercise/JavaScript_Basics/continue_break.md @@ -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++) {} + ``` \ No newline at end of file