Lesson 5 of 55
javascriptControl Flow – if / switch / loops
10 mins
Course progress9%
What you'll learn
Keep these ideas in mind as you work through the lesson.
Lesson 5 of 55
javascript10 mins
Keep these ideas in mind as you work through the lesson.
Conditional statements (if, else if, else) and switch for multi‑branch logic.
Looping constructs:
for (init; condition; final)while (condition)do … while (condition)for…of – iterates over iterable objects.for…in – iterates over enumerable property names.for…ofconst colors = ['red','green','blue'];
for (const c of colors) {
console.log(c);
}