© Deepak Grover and Hanu Kunduru 2017

Deepak Grover and Hanu Prateek Kunduru, ES6 for Humans, https://doi.org/10.1007/978-1-4842-2623-0_8

8. Iterators and Generators

Deepak Grover and Hanu Prateek Kunduru2

(1)Delhi, India

(2)Seattle, Washington, USA

In this chapter, we will be learning all about the newly introduced iterators and generators, which bring simplicity and customizability to the traversing mechanism in JavaScript. A lot of programming languages have already moved away from the boring old for loops that required additional efforts to keep track of the current index position while traversing through the items in the collection. Let’s take a look at how we can use iterators and generators to efficiently process data in our applications. ...

Get ES6 for Humans: The Latest Standard of JavaScript: ES2015 and Beyond now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.