Subscribe to Evented Mind to watch the full video.

Already have an Evented Mind subscription?

Subscribe to Evented Mind to watch the full video.

Need a second look? Watch again

ES2015

Generators

Generators provide a much nicer syntax for performing iteration. A generator function automatically returns a special generator object. The generator object has a next method just like the custom iterator method we wrote. Except, now we can simply use the yield keyword to pass control to the caller. In this video we'll rewrite our custom iterator method to use generators instead.

  • JavaScript
Join the Discussion

Want to leave a comment? .