Standard built-ins
AsyncGenerator.prototype.next()
Queues a request to resume an async generator and returns a promise for the next iteration result.
Formal Syntax & Structure
javascript syntaxjavascript
asyncGenerator.next([value])Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| value | any | Optional resumption, completion or error value. |
Return Value
Promise<IteratorResult>
Promise for the iteration result.
Working Example
Example Snippetjavascript
async function* g(){try{yield 1;}catch(e){yield e.message;}}(async()=>{const i=g();console.log((await i.next()).value);})();