Update article.md

"we should use `for...loop`" -> "we should use a `for...loop`"
This commit is contained in:
Peter Roche 2020-02-28 22:32:22 -07:00 committed by GitHub
parent 7550fd59fa
commit 177f4b3b5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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: