You no longer need to write generator functions to create basic lazy iterator functions.
Now, ECMAScript supports iterator helpers that you can call on Array.values()
. With these helpers, the values of an array will be operated on lazily, and will only run when the values are needed.