Back
Close

JavaScript, async and await keywords

Magus
42.5K views

Call multiple functions with await in parallel

If you try this code :

Sequential multiple awaits

You can see that the job function is called sequentially. But in such code, you probably want to make the 3 calls in parallel. You have to use your old friend Promise.all

Parallel multiple awaits

You can await anything

You can use the await keyword even if the result is not a promise.

You can await anything
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io