Too Long; Didn't Read
Using generators and iterators are (somewhat) new JavaScript features introduced with ES6. They are built-in symbols for turning your custom objects into iterables. They provide a way for custom data structures to work nicely in the larger JS environment. For example, the Immutable.JS library uses iterators to provide native Javascript functionality for their custom. objects such as the. Immutable.JS library. uses them to provide. native Javascript function to turn plain old JavaScript objects into. iterables: In ES6, you compute the dataset on demand rather than upfront like with traditional for loops.