Loops allow you to execute a block of code repeatedly until a condition is met.
Types of Loops
- for — repeats a block a specific number of times.
- while — repeats while a condition is true.
- do...while — repeats at least once, then checks condition.
for (let i = 0; i < 5; i++) { console.log(i); }