Update article.md
"we should use `for...loop`" -> "we should use a `for...loop`"
This commit is contained in:
parent
7550fd59fa
commit
177f4b3b5e
1 changed files with 1 additions and 1 deletions
|
@ -52,7 +52,7 @@ If necessary, please refer to the [chapter about iterables](info:iterable) for d
|
|||
To make the object iterable asynchronously:
|
||||
1. We need to use `Symbol.asyncIterator` instead of `Symbol.iterator`.
|
||||
2. `next()` should return a promise.
|
||||
3. To iterate over such an object, we should use `for await (let item of iterable)` loop.
|
||||
3. To iterate over such an object, we should use a `for await (let item of iterable)` loop.
|
||||
|
||||
Let's make an iterable `range` object, like the one before, but now it will return values asynchronously, one per second:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue