JavaScript Lesson 2: Control Structures and Loops
Page 1: Introduction to Control Flow in JavaScript
What is Control Flow?
o Control flow refers to how your code executes, especially in conditions where you want
the program to decide or repeat based on logic.
o JavaScript uses conditional statements and loops to manage control flow.
Types of Control Structures
o Conditionals: if, else if, and else.
o Loops: for, while, and do while.
Page 2: Conditional Statements
if, else if, and else statements: These are used when you want to execute code based on certain
conditions.
o if statement: Executes code if the condition is true.