1. 4

In this article we will explore different ways to create iterators and iterable values in Javascript, specifically functions, iterators, iterables and generators.

JavaScript is a very flexible language and most often you can achieve the same goals in many different ways, iterators are no exception!


  2. 2

    I really wish that JavaScript would just provide one way of doing this stuff. I can’t think of the last time I had to use an iterator, but if I do, I don’t feel like I should have to make a decision. What is the JavaScript community converging on as the true answer here?

    1. 1

      By using an iterator do you mean creating a custom one or simply using an iterator object from an existing lib?

      I get your point about JS and the many ways to do one thing, but I actually find ECMAScript 2015 to have done something very powerful here with creating a standard and interoperable way to define synchronous iterable objects.