Update article.md
This commit is contained in:
parent
362483e37f
commit
1757746fb6
1 changed files with 2 additions and 2 deletions
|
@ -12,9 +12,9 @@ async function f() {
|
|||
}
|
||||
```
|
||||
|
||||
The word "async" before a function means one simple thing: a function always returns a promise. If it's not so, then the value is wrapped in `Promise.resolve`.
|
||||
The word "async" before a function means one simple thing: a function always returns a promise. If the code has `return <non-promise>` in it, then JavaScript automatically wraps it into a resolved promise with that value.
|
||||
|
||||
For instance, the code above returns `Promise.resolve(1)`:
|
||||
For instance, the code above returns a resolved promise with the result of `1`:
|
||||
|
||||
```js run
|
||||
async function f() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue