Make a generator end and return
calling gen.return()
is like injecting a return
into the generator
Required Knowledge
- `let` declaration (Block scope)
- creation (Generator)
- iterator (Generator)
- yield expressions (Generator)
- send value to a generator (Generator)
- send function to a generator (Generator)
Related Katas
Generator
- creation
- iterator
- yield expressions
- send value to a generator
- send function to a generator
return
inside a generator function- send return to a generator
Difficulty Level
EXPERT
First Published
7 June 2025
Stats
1 tests to solve