mdn / sprints

Archived: MDN Web Docs issues are tracked in the content repository.
https://github.com/mdn/content
Creative Commons Zero v1.0 Universal
150 stars 142 forks source link

Update the async/await docs in the "Learn web development" module #3945

Closed ghost closed 3 years ago

ghost commented 3 years ago

Request type

Details

The issue concerns the following page: https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Asynchronous/Async_await

In the "The downsides of async/await" section, a timeTest code from fast-async-await.html is provided as an example where we create and await promises separately and speed up the execution: image

However, the solution used here can lead to unhandled promise rejection errors, as mentioned in another reference doc about async functions (see the "Examples" section):

image image

Additional, more detailed explanation about the downsides of this approach can also be found on StackOverflow.

As a fix, a similar note highlighting the issues can be provided on the page, or perhaps the example can be reworked to use Promise.all.

chrisdavidmills commented 3 years ago

Issue moved to mdn/content #1445 via ZenHub