DEV Community

Discussion on: Practical Ways to Write Better JavaScript

 
pavelloz profile image
Paweł Kowalski

I would say the moment you slap await in there, the code is no longer asynchronous. It's blocking as any other line.

Thread Thread
 
taillogs profile image
Ryland G

That’s not true. If I await a web request in some random function, it will still be asynchronous as long as the random function is invoked asynchronously.

Thread Thread
 
pavelloz profile image
Paweł Kowalski

Try doing two awaits in a row and check if they run concurrently. This is the definition of synchronous.