Delegate JavaScript (ES6) generator iteration control

Share this video with your friends

Send Tweet

We can execute generators from generators, and delegate the iteration control with the yield* keyword.

Yo dawg, I heard you like generators, so I put generators inside your generators.

Vamshi
Vamshi
~ 8 years ago

Can you help me understand how 3 was consoled out when we returned only 4?

Anshuman
Anshuman
~ 8 years ago

Because of the

yield 3

line in create3To4Counter()

Dash
Dash
~ 7 years ago

When in the world would we ever use this?