Generators can be created in multiple ways
the most common way is by adding *
after function
as a function expression, by adding a *
after function
inside an object by prefixing the function name with *
computed generator names, are just prefixed with a *
inside a class the same way
Links
Describes the `function*` declaration.
Required Knowledge
- `let` declaration (Block scope)
- `const` declaration (Block scope)
- computed properties (Object literal)
- creation (Class)
Related Katas
Generator
- creation
- iterator
- yield expressions
- send value to a generator
- send function to a generator
return
inside a generator function
Difficulty Level
TBD
First Published
1 June 2015
Stats
5 tests to solve