ES6 for of loop

The for of statement loops through the values of an iterable object.

It lets you loop over iterable data structures such as Arrays, Strings, Maps, NodeLists, and more:


const list = ['a', 'b', 'c'];

for (const element of list) {
  console.log(element);
}

// output: "a"
// output: "b"
// output: "c"