Javascript — Loops
Loops allow you to repeat code multiple times, saving effort and code space. The 'for' loop runs a set number of times, 'while' repeats while a condition is true, and 'do...while' runs at least once before checking the condition. Loops are essential for iterating over arrays and handling repetitive tasks.
for (let i = 1; i <= 5; i++) {
console.log(i);
}