1×
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.

Autoplay

    Use a Generator Like a Closure

    javascriptJavaScript

    Generators emulate the behavior of a closure where they wrap an initial value then can take subsequent values through next to yield something based on that initial wrapped value. This lesson walks through creating a closure then re-creating the same behavior with a generator.