bhylu.com

Advertisements

JS Loops

A loop repeats work. Decide which value changes and what condition will stop the repetition.

Where to run this

This example uses the JavaScript console playground. Select Run to execute it; the example does not run on this lesson page.

A practical example

JavaScript

for (const name of ["Mira", "Jon"]) {
  console.log("Hello, " + name);
}

What happens

Each learner gets one greeting.