Javascript Mistakes: Async Code with Promises. Just use Async/Await!

Veröffentlicht am: 12 April 2023
auf dem Kanal: Th30z Code
159
15

When using Javascript, Typescript or any other programming language, beware of asynchronous functions (the ones returning a Promise).

The code execution will become non-linear. If you don't pay attention, with the right timing the code may seem to work, but it will not always work (because it is not correct).

If you need to wait the completion of an async function before executing something, use await or put your code inside .then() and .catch().

We strongly encourage the use of async/await to improve the readability of the code.

#javascript #typescript #shorts #codingtips #asyncawait #programming #coding


Auf dieser Seite können Sie das Online-Video Javascript Mistakes: Async Code with Promises. Just use Async/Await! mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Th30z Code 12 April 2023 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 159 Mal angesehen und es wurde von 15 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!