JavaScript Professional — Medium
Key points
- Passing arguments to the `next()` method affects the yield value
- The first `next()` call starts the generator
- Each `next()` call resumes the generator from the last yield
- The value returned by `next()` is accessed using `.value`
- The `return` statement in the generator ends the iteration
Ready to go further?
Related questions
