7
Iterators and Generators
WHAT'S IN THIS CHAPTER?
- Introduction to iteration
- The iterator pattern
- Generators
WROX.COM DOWNLOADS FOR THIS CHAPTER
Please note that all the code examples for this chapter are available as a part of this chapter’s code download on the book's website at www.wrox.com/go/projavascript4e
on the Download Code tab.
The term “iteration” is derived from the Latin itero, meaning “repeat” or “do again.” In the context of software, “iteration” means repetitively performing a procedure multiple times, in sequence, and usually with an expectation of termination. The ECMAScript 6 specification introduces two high-level features—iterators and generators—to allow for cleaner, faster, and easier iteration.