Back to course home
0% completed
JavaScript - for-of loop
The for-of
loop provides a modern way to iterate over iterable objects in JavaScript, such as Arrays, Maps, Sets, and even Strings. This loop simplifies the process of traversing collections by directly providing access to the values rather than the indexes or keys. It's particularly useful for cases where you need to work with the elements of a collection directly and do not require access to the index or key.
Syntax
The syntax of the for-of
loop is straightforward and intuitive:
.....
.....
.....
Like the course? Get enrolled and start learning!
Table of Contents
Contents are not accessible
Contents are not accessible
Contents are not accessible
Contents are not accessible
Contents are not accessible