1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-28 21:32:20 +00:00

Merge pull request #300 from hanzhijue/gh-pages

Fix type in promise.md
This commit is contained in:
Ruan YiFeng 2016-12-28 19:37:20 -06:00 committed by GitHub
commit 124b154496

View File

@ -816,7 +816,7 @@ console.log('next');
// next
```
上面代码中,第行是一个立即执行的匿名函数,会立即执行里面的`async`函数,因此如果`f`是同步的,就会得到同步的结果;如果`f`是异步的,就可以用`then`指定下一步,就像下面的写法。
上面代码中,第行是一个立即执行的匿名函数,会立即执行里面的`async`函数,因此如果`f`是同步的,就会得到同步的结果;如果`f`是异步的,就可以用`then`指定下一步,就像下面的写法。
```javascript
(async () => f())()