paint-brush
A common misconception about async/await in JavaScriptby@luc.claustres
29,136 reads
29,136 reads

A common misconception about async/await in JavaScript

by Luc Claustres2mFebruary 13th, 2018
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Some developers tend to believe that the function written with async/await will always be executed synchronously. This is because the code looks like if we wait synchronously for the delayed operation before continuing the execution. Like with promises, it is up to the caller to decide if the code will run synchronously or not. That’s the reason why the code does not work as expected with constructs like for Each. If the caller does not make use of await(respectively then with promises) then your code will not run synchronous.
featured image - A common misconception about async/await in JavaScript
Luc Claustres HackerNoon profile picture
Luc Claustres

Luc Claustres

@luc.claustres

Digital Craftsman, Co-Founder of Kalisio, Ph.D. in Computer Science

Learn More
LEARN MORE ABOUT @LUC.CLAUSTRES'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Luc Claustres HackerNoon profile picture
Luc Claustres@luc.claustres
Digital Craftsman, Co-Founder of Kalisio, Ph.D. in Computer Science

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite