Search completed in 1.52 seconds.
4 results for "AsyncIterator":
Symbol.asyncIterator - JavaScript
the symbol.
asynciterator well-known symbol specifies the default
asynciterator for an object.
... description the symbol.
asynciterator symbol is a builtin symbol that is used to access an object's @@
asynciterator method.
... in order for an object to be async iterable, it must have a symbol.
asynciterator key.
...And 5 more matches
Symbol - JavaScript
static properties symbol.
asynciterator a method that returns the default
asynciterator for an object.
for await...of - JavaScript
examples iterating over async iterables you can also iterate over an object that explicitly implements async iterable protocol: const asynciterable = { [symbol.
asynciterator]() { return { i: 0, next() { if (this.i < 3) { return promise.resolve({ value: this.i++, done: false }); } return promise.resolve({ done: true }); } }; } }; (async function() { for await (let num of asynciterable) { console.log(num); } })(); // 0 // 1 // 2 iterating over async generators since the return values of asyn...