diff --git a/1-js/11-async/08-async-await/01-rewrite-async/task.md b/1-js/11-async/08-async-await/01-rewrite-async/task.md index e2fd375d..a04b4ff9 100644 --- a/1-js/11-async/08-async-await/01-rewrite-async/task.md +++ b/1-js/11-async/08-async-await/01-rewrite-async/task.md @@ -12,7 +12,7 @@ function loadJson(url) { } else { throw new Error(response.status); } - }) + }); } loadJson('no-such-user.json') diff --git a/1-js/11-async/08-async-await/02-rewrite-async-2/task.md b/1-js/11-async/08-async-await/02-rewrite-async-2/task.md index a5c1c03a..13d625d2 100644 --- a/1-js/11-async/08-async-await/02-rewrite-async-2/task.md +++ b/1-js/11-async/08-async-await/02-rewrite-async-2/task.md @@ -1,7 +1,7 @@ # Rewrite "rethrow" with async/await -Below you can find the "rethrow" example from the chapter . Rewrite it using `async/await` instead of `.then/catch`. +Below you can find the "rethrow" example. Rewrite it using `async/await` instead of `.then/catch`. And get rid of the recursion in favour of a loop in `demoGithubUser`: with `async/await` that becomes easy to do. @@ -22,7 +22,7 @@ function loadJson(url) { } else { throw new HttpError(response); } - }) + }); } // Ask for a user name until github returns a valid user diff --git a/1-js/11-async/08-async-await/article.md b/1-js/11-async/08-async-await/article.md index 29bfcaf5..176c691e 100644 --- a/1-js/11-async/08-async-await/article.md +++ b/1-js/11-async/08-async-await/article.md @@ -156,7 +156,7 @@ class Thenable { // resolve with this.num*2 after 1000ms setTimeout(() => resolve(this.num * 2), 1000); // (*) } -}; +} async function f() { // waits for 1 second, then result becomes 2