← CodePrimer
JavaScript
Beginner
Basics
for...of over an array
How do I loop array values cleanly?
for...of.
const skills = ['HTML', 'CSS', 'JS'];
for (const skill of skills) {
console.log(skill);
}
Notes
for...in is for object keys — usually avoid for arrays.
Keywords: for of · array · loop
Related
HTML
HTML headings h1–h6
How do I create page headings?
CSS
Three ways to apply CSS
What are inline, internal, and external CSS?
JavaScript
document.getElementById
How do I select one element by id?
PHP
Embed PHP inside HTML
How do I mix PHP and HTML?
HTML
Paragraphs and line breaks
How do I break text into paragraphs?
CSS
CSS box model
Why is my element wider than expected?