Skip to content

Commit 5119c2c

Browse files
author
Ruan YiFeng
authored
Merge pull request ruanyf#633 from xianshenglu/patch-1
完善下表述
2 parents 4123978 + 9e86918 commit 5119c2c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/async.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ async function f() {
757757
// b
758758
```
759759

760-
上面代码中,`createAsyncIterable()`返回一个异步遍历器`for...of`循环自动调用这个遍历器的`next`方法,会得到一个 Promise 对象。`await`用来处理这个 Promise 对象,一旦`resolve`,就把得到的值(`x`)传入`for...of`的循环体。
760+
上面代码中,`createAsyncIterable()`返回一个拥有异步遍历器的对象`for...of`循环自动调用这个对象的异步遍历器的`next`方法,会得到一个 Promise 对象。`await`用来处理这个 Promise 对象,一旦`resolve`,就把得到的值(`x`)传入`for...of`的循环体。
761761

762762
`for await...of`循环的一个用途,是部署了 asyncIterable 操作的异步接口,可以直接放入这个循环。
763763

0 commit comments

Comments
 (0)