Closed ghost closed 3 years ago
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:
timeTest
fast-async-await.html
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):
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.
Promise.all
Issue moved to mdn/content #1445 via ZenHub
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 fromfast-async-await.html
is provided as an example where we create and await promises separately and speed up the execution: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):
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
.