r/learnjavascript • • May 01 '20

Async vs. Sync

Post image
413 Upvotes

81 comments sorted by

View all comments

9

u/zbluebirdz May 01 '20

If you had each task dependent on the previous task's results/outcome, can you still run it in Asynchronous mode?

9

u/robotmayo May 01 '20

Yes because you are describing one task. Most tasks are made up of smaller tasks.

2

u/zbluebirdz May 01 '20

So, it'll end up being like the Synchronous picture?

2

u/golovatuy May 01 '20

if you have dependency you have to wait task results. Use async/await or Promise for dependent tasks for asynchronous mode.