Generators are a level up from iterators. Not only can they be used to make non-iterable objects in JavaScript iterable, but they can also serve as a standalone iterable. This duality provides a lot of flexibility for developers on how and where they can create iterable objects throughout their applications.

In this video, I’ll walk you through the basics of generators by showing you how they can work as both iterators and iterables. I’ll show you how to create generators by using generator functions.


What They Are and How They're the Overpowered Iterator
1.25 GEEK