Skip to content

Commit 6d69d77

Browse files
authored
Merge pull request #696 from StormKMD/patch-1
Readability changes to async/await page
2 parents eb5416b + e66b4ff commit 6d69d77

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

6-async/05-async-await/article.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ function f() {
8383
}
8484
```
8585

86-
We can get such error in case if we forget to put `async` before a function. As said, `await` only works inside `async function`.
86+
We will get this error if we do not put `async` before a function. As said, `await` only works inside an `async function`.
8787
````
8888
89-
Let's take `showAvatar()` example from the chapter <info:promise-chaining> and rewrite it using `async/await`:
89+
Let's take the `showAvatar()` example from the chapter <info:promise-chaining> and rewrite it using `async/await`:
9090
91-
1. We'll need to replace `.then` calls by `await`.
91+
1. We'll need to replace `.then` calls with `await`.
9292
2. Also we should make the function `async` for them to work.
9393
9494
```js run
@@ -122,7 +122,7 @@ showAvatar();
122122
Pretty clean and easy to read, right? Much better than before.
123123
124124
````smart header="`await` won't work in the top-level code"
125-
People who are just starting to use `await` tend to forget that, but we can't write `await` in the top-level code. That wouldn't work:
125+
People who are just starting to use `await` tend to forget the fact that we can't use `await` in top-level code. For example, this will not work:
126126
127127
```js run
128128
// syntax error in top-level code

0 commit comments

Comments
 (0)