The GeneratorFunction
object provides methods for generator functions. In JavaScript, every generator function is actually a GeneratorFunction
object.
Note that GeneratorFunction
is not a global object. It can be obtained with the following code:
const GeneratorFunction = function* () {}.constructor;
GeneratorFunction
is a subclass of Function
.
Instance methods
Inherits instance methods from its parent Function
.
Specifications
Browser compatibility
|
Desktop |
Mobile |
Server |
|
Chrome |
Edge |
Firefox |
Opera |
Safari |
Chrome Android |
Firefox for Android |
Opera Android |
Safari on IOS |
Samsung Internet |
WebView Android |
Deno |
Node.js |
GeneratorFunction |
39 |
13 |
26 |
26 |
10 |
39 |
26 |
26 |
10 |
4.0 |
39 |
1.0 |
4.0.0 |
GeneratorFunction |
39 |
13 |
26 |
26 |
10 |
39 |
26 |
26 |
10 |
4.0 |
39 |
1.0 |
4.0.0 |