Nearby lessons

21 of 40

📋 JavaScript for...of Loop

📌 What is JavaScript for...of Loop?

The for...of loop iterates over iterable objects (arrays, strings, etc).

Modern way to iterate collections.

📋 for...of Basics

AttributeDescription
Syntaxfor (value of iterable)
Works WithArrays, Strings, Maps, Sets
BenefitsClean syntax, works with iterables
Example02
Code Cell
Loading Editor...
✏️ You can edit this code — click Run to refresh the preview.
Output

🧠 Test Your Knowledge

2 Questions
Progress: 0 / 2