GO-V.ORG
As seen in

Search e01

One query across the encyclopedia, books, dictionary, papers, Wikidata and the developer library. Every hit carries its source.

6 results across 6 corpora for AsyncGenerator.

Developer library 6

JavaScript reference

mics - JSON ### Managing memory - WeakRef - FinalizationRegistry ### Control abstraction objects - Iterator - AsyncIterator - Promise - GeneratorFunction - AsyncGeneratorFunction - Generator - AsyncGenerator - AsyncFunction - DisposableStack - AsyncDisposableStack ### Reflection - AbstractModuleSource - Reflect - Proxy ### Internationalization - Intl - Intl.Collator - Intl.DateTimeFormat - Intl.DisplayNames -

MDN Web Docs mirror · CC BY-SA 2.5 (MDN) · https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference

async function*

ns#function_parameters). - `statements` - : The statements comprising the body of the function. ## Description An `async function*` declaration creates an AsyncGeneratorFunction object. Each time when an async generator function is called, it returns a new AsyncGenerator object, which conforms to the [async iterator protocol](/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterabl

for await...of

Since the return values of async generator functions conform to the async iterable protocol, they can be looped using `for await...of`. ```js async function* asyncGenerator() { let i = 0; while (i < 3) { yield i++; } } (async () => { for await (const num of asyncGenerator()) { console.log(num); } })(); // 0 // 1 // 2 ``` For a more concrete example of iterating over an async generator using `for

Iteration protocols

ion, the [`arguments`](/docs/Web/JavaScript/Reference/Functions/arguments) object and some DOM collection types such as NodeList are also iterables. Other than AsyncGenerator, there is no object in the core JavaScript language that is async iterable. Some web APIs, such as ReadableStream, have the `Symbol.asyncIterator` method set by default. [Generator functions](/docs/Web/JavaScript/Reference/Statements/function*)

Standard built-in objects

help to structure code, especially async code (without using deeply nested callbacks, for example). - Iterator - AsyncIterator - Promise - GeneratorFunction - AsyncGeneratorFunction - Generator - AsyncGenerator - AsyncFunction - DisposableStack - AsyncDisposableStack ### Reflection - AbstractModuleSource - Reflect - Proxy ### Internationalization Additions to the ECMAScript core for language-sensitive functional

AsyncGeneratorFunction

The **`AsyncGeneratorFunction`** object provides methods for [async generator functions](/docs/Web/JavaScript/Reference/Statements/async_function*). In JavaScript, every async generator function is actually an `AsyncGeneratorFunction` object. Note that `AsyncGeneratorFunction` is _not_ a global object. It can be obtained with the following code: ```js const AsyncGeneratorFunction = async function* () {}.constructor

JSON results · Services directory