Tin mới
JavaScript: Scripting language
Web APIs: Programming interfaces
Structuring content with HTML module
Dynamic scripting with JavaScript module
The AsyncGenerator object is returned by an async generator function and it conforms to both the async iterable protocol and the async iterator protocol.
async iterable protocol and the async iterator protocol
The AsyncGenerator object is returned by an async generator function and it conforms to both the async iterable protocol and the async iterator protocol.
AsyncGeneratorFunction.prototype.prototype
There's no JavaScript entity that corresponds to the AsyncGenerator constructor. Instances of AsyncGenerator must be returned from async generator functions:
AsyncGenerator.prototype.constructor
The constructor function that created the instance object. For AsyncGenerator instances, the initial value is AsyncGeneratorFunction.prototype.
AsyncGeneratorFunction.prototype
The constructor function that created the instance object. For AsyncGenerator instances, the initial value is AsyncGeneratorFunction.prototype.
The initial value of the [Symbol.toStringTag] property is the string "AsyncGenerator". This property is used in Object.prototype.toString().
The initial value of the [Symbol.toStringTag] property is the string "AsyncGenerator". This property is used in Object.prototype.toString().
AsyncGenerator.prototype.next()
Returns a Promise which will be resolved with the given value yielded by the yield expression.
AsyncGenerator.prototype.return()
Returns a Promise which will be resolved with the given value yielded by the yield expression.
AsyncGenerator.prototype.throw()
Returns a Promise which will be resolved with the given value yielded by the yield expression.
This page was last modified on Jul 10, 2025 by MDN contributors.