Actually the setTimeout in your example isn’t necessary. Any promise is already implicitly going to be asynchronous. The reason your code is running in parallel is because you’re setting up all three promises before you start awaiting any of them.

works for PayPal, as a lead engineer in Checkout. Opinions expressed herein belong to him and not his employer. daniel@bluesuncorp.co.uk

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store