DEV Community

Discussion on: Explain Async/Await Like I'm Five

Collapse
 
raulismasiukas profile image
Raulis Masiukas

Code can be synchronous, where a line of code has to be completed before you can move on to the next one, and asynchronous, where the program will move on to the next line without waiting for the previous line to finish.
Async/await makes asynchronous code feel synchronous, aka won't move to the next line until the previous line finishes execution, whilst in fact it's asynchronous in the background. It's much easier to read code line by line than having to parse the cognitive complexity that promises introduce.