Day 6 of 14 30 minforwhilefor...ofbreak / continue
Repeat work without repeating code. Count with for, loop until something changes with while, walk through arrays and strings with for...of, through object keys with for...in, and control loops with break and continue.
By the end of today you can
- Write a counting for loop and explain its three parts
- Use while for loops that run until a condition changes
- Loop over arrays and strings with for...of
- Loop over an object's keys with for...in or Object.entries()
- Control loops with break and continue, and avoid infinite loops
What's inside
- 6 sections
- 3 diagrams and mind maps
- 7 code examples you can run
- 5-question quiz
- 1The for loop: counting
- 2while: loop until something changes
- 3for...of: every item in a list
- 4for...in and Object.entries: keys of an object
- 5break and continue
- 6Which loop should I use?
Sign in free to read this lesson
Get the full lesson with diagrams, runnable code and the quiz. Your progress is saved across devices.
Sign in free