Sometimes it's necessary to arrange asynchronous operations in a series. In previous recipes, we've seen how to do this with Promise.then. In this recipe, we'll see how to do the same thing with the await operator.
Awaiting multiple results in a series
Getting ready
This recipe assumes you already have a workspace that allows you to create and run ES modules in your browser. If you don't, please see the first two chapters.
How to do it...
- Open your command-line application and navigate to your workspace.
- Create a new folder named 04-03-async-function...