Avoid Nested For Loops with Generators

Share this video with your friends

Send Tweet

Generators allow you to hook together multiple generators with the yield* syntax. This allows you to branch off into many different types of iterations within the main iteration and covers complex scenarios where you usually end up reaching for nested for loops.