Using async results in a Promise chain

In the previous recipe, we saw how to use async and await to replace portions of the Promise API. However, there will still be cases where it is preferable to use the Promise API, either for clarity, structure, or incremental replacement.

In this recipe, we'll see how the async functions integrate seamlessly into Promise chains.

Get ECMAScript Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.