Skip to content

Commit 5856120

Browse files
Update article.md
Fixed typos and made grammar changes.
1 parent 0a95d04 commit 5856120

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

1-js/11-async/08-async-await/article.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ async function f() {
2424
f().then(alert); // 1
2525
```
2626

27-
...We could explicitly return a promise, that would be the same:
27+
...We could explicitly return a promise, that would be the same as:
2828

2929
```js run
3030
async function f() {
@@ -72,7 +72,7 @@ Let's emphasize: `await` literally makes JavaScript wait until the promise settl
7272
It's just a more elegant syntax of getting the promise result than `promise.then`, easier to read and write.
7373

7474
````warn header="Can't use `await` in regular functions"
75-
If we try to use `await` in non-async function, that would be a syntax error:
75+
If we try to use `await` in non-async function, there would be a syntax error:
7676

7777
```js run
7878
function f() {
@@ -250,7 +250,7 @@ async function f() {
250250
f();
251251
```
252252

253-
If we don't have `try..catch`, then the promise generated by the call of the async function `f()` becomes rejected. We can append `.catch` to handle it:
253+
If we don't have `try..catch` and a promise generated by the call of the async function `f()` becomes rejected. We can append `.catch` to handle it:
254254

255255
```js run
256256
async function f() {
@@ -263,7 +263,7 @@ f().catch(alert); // TypeError: failed to fetch // (*)
263263
*/!*
264264
```
265265

266-
If we forget to add `.catch` there, then we get an unhandled promise error (and can see it in the console). We can catch such errors using a global event handler as described in the chapter <info:promise-error-handling>.
266+
If we forget to add `.catch` there, then we get an unhandled promise error (viewable in the console). We can catch such errors using a global event handler as described in the chapter <info:promise-error-handling>.
267267

268268

269269
```smart header="`async/await` and `promise.then/catch`"

0 commit comments

Comments
 (0)