The GeneratorFunction()
constructor creates GeneratorFunction
objects.
Note that GeneratorFunction
is not a global object. It can be obtained with the following code:
js
const GeneratorFunction = function* () {}.constructor;
The GeneratorFunction()
constructor is not intended to be used directly, and all caveats mentioned in the Function()
description apply to GeneratorFunction()
.