InterviewHubPRO
Section Overview
Q328

Question 328 of 521

Part 5: ES6+ Modern Syntax, Classes, Modules & Destructuring (254 - 328)

63%
JavaScript Internals (521 Qs)•Part 5: ES6+ Modern Syntax, Classes, Modules & Destructuring (254 - 328)

What is for...of statement

The for...of statement creates a loop iterating over iterable objects or elements such as built-in String, Array, Array-like objects (like arguments or NodeList), TypedArray, Map, Set, and user-defined iterables. The basic usage of for...of statement on arrays would be as below,

javascript
  let arrayIterable = [10, 20, 30, 40, 50];

  for (let value of arrayIterable) {
    value++;
    console.log(value); // 11 21 31 41 51
  }