Skip to content

Latest commit

 

History

History
19 lines (12 loc) · 535 Bytes

what_is_for_of_statement.md

File metadata and controls

19 lines (12 loc) · 535 Bytes

What is for...of statement?

The for...of statement is used to iterate over the values of iterable objects (like arrays, strings, maps, etc.) in JavaScript. It provides a simpler syntax than traditional loops and works well with iterables.

Example:

let arr = [10, 20, 30];
for (let value of arr) {
  console.log(value);
}
// Output: 10 20 30

Tags: intermediate, JavaScript, Loops