Loops
Loops are one key control flow structure of any programming language. JavaScript provides quite a few different ways to loop.

Join the AI Workshop to learn more about AI and how it can be applied to web development. Next cohort February 1st, 2026

The AI-first Web Development BOOTCAMP cohort starts February 24th, 2026. 10 weeks of intensive training and hands-on projects.


Loops are one of the fundamental concepts of any programming language.

Using a loop we can execute a piece of code multiple times to perform all kind of tasks.

From the basic loop that prints a number from 1 to 10, up to looping an array and printing its values in a JSX template, loops are invaluable and you use them all the time.

In this unit I’ll introduce how we can loop in JavaScript.

Lessons in this unit:

0: ▶︎ Introduction
1: The `for` loop
2: The `do-while` loop
3: The `while` loop
4: The `for-of` loop
5: The `for-in` loop
6: Other kinds of loops