The Symbol.asyncIterator property is used to set an object as an async iterable. Iterable properties of this object can be iterated over using a for await…of loop.
An async iterable object is any object that returns a function which produces an AsyncIterator for its Symbol.asyncIterator property.
The Symbol.asyncIterator symbol is a built-in symbol that is used to access an object’s @@asyncIterator method.
Note: For an object to be an async iterable, it must have a Symbol.asyncIterator key.
Property attributes of Symbol.asyncIterator Writable no Enumerable no Configurable no
Example codes for the above property are as follows:
0 3 6 9
0 1 2 3 4
- Google Chrome