flâneur — a map of the web's best reading

Generator - JavaScript | MDN

developer.mozilla.org · 463 words · saved by 1 readers

The Generator object is returned by a generator function and it conforms to both the iterable protocol and the iterator protocol. Generator is a subclass of the hidden Iterator class. There's no JavaScript entity that corresponds to the Generator constructor. Instances of Generator must be returned from generator functions: There's only a hidden object which is the prototype object shared by all objects created by generator functions. This object is often stylized as Generator.prototype to make it look like a class, but it should be more appropriately called GeneratorFunction.prototype.prototype, because GeneratorFunction is an actual JavaScript entity. To understand the prototype chain of Generator instances, see GeneratorFunction.prototype.prototype. These properties are defined on Generator.prototype and shared by all Generator instances. The constructor function that created the instance object. For Generator instances, the initial value is GeneratorFunction.prototype. Note: Genera

Generator - JavaScript | MDN Skip to main content Skip to search Generator Baseline Widely available This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2016. Learn more See full compatibility The Generator object is returned by a generator function and it conforms to both the iterable protocol and the iterator protocol . Generator is a subclass of the Iterator class. Constructor There's no JavaScript entity that corresponds to the Generator constructor. Instances of Generator must be returned from generator f

Explore this link on the map →

related reading