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

Publicado el: 12 abril 2023
en el canal de: 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


En esta página del sitio puede ver el video en línea Javascript Mistakes: Async Code with Promises. Just use Async/Await! de Duración hora minuto segunda en buena calidad , que subió el usuario Th30z Code 12 abril 2023, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 159 veces y le gustó 15 a los espectadores. Disfruta viendo!