mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-24 18:32:22 +00:00
Update promise.md
Fix typo
This commit is contained in:
parent
a44b2f0fa8
commit
5ea84ae9a9
@ -816,7 +816,7 @@ console.log('next');
|
|||||||
// next
|
// next
|
||||||
```
|
```
|
||||||
|
|
||||||
上面代码中,第一行是一个立即执行的匿名函数,会立即执行里面的`async`函数,因此如果`f`是同步的,就会得到同步的结果;如果`f`是异步的,就可以用`then`指定下一步,就像下面的写法。
|
上面代码中,第二行是一个立即执行的匿名函数,会立即执行里面的`async`函数,因此如果`f`是同步的,就会得到同步的结果;如果`f`是异步的,就可以用`then`指定下一步,就像下面的写法。
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
(async () => f())()
|
(async () => f())()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user