Introducing the for-of loop

Javascript syntax for the for-of loop

The for-of loop is a new powerful construct in ES6 that simplifies your code.

The for-of loop works for any JavaScript iterable object. We will use the for-of loops on arrays, strings, and NodeLists.

In our first example, let’s log the characters of a string:

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.