JavaScript loops and iteration
Last updated: November 2, 2025
Introduction
OK. So, there are more ways to iterate over things…
You're on a small screen! Some modules like CodePen examples will behave differently here. You'll need to toggle through their tabs to see all the code. For the best experience, consider using a bigger screen.
Recap
…
Live examples
See the Pen HTML cheatsheet 1 / display types by perpetual.education (@perpetual-education) on CodePen.
Do what while what?
MDN: do…while statement (loop)
Let’s do these before the for loop – because they are simple… but have more to consider in a way… and the for loop kinda encapsulates it all.
for statement
…
Break and Continue
…