...

/

Using Custom Iterators

Using Custom Iterators

Learn which data types can be iterated with for loop and which needs symbols to iterate over them.

The built-in collections in JavaScript, like Array, Set, and Map, are all iterable. Using the for loop, we can iterate over them to process the elements. But, what about user-defined classes?

svg viewer

Iterators for user-defined classes

...
Access this course and 1400+ top-rated courses and projects.