DEV Community

Discussion on: I just don't understand async/await 😢!

Collapse
 
inigogb profile image
BaronVonHex • Edited

My suggestion is that you go to Mozilla developer network and inside the JavaScript documentation you search for everything related to Promises. Async/await is just syntactic sugar wrapping around a Promise. I apologize if this doesn't answer your question in full.

PS: userExists is executing before the other one because even if the two of them look "ordered" in code when they are placed inside the event loop the one that finishes first will be "fulfilled" and thus return before the other