How it works...

As mentioned previously, async functions resolve their results with a Promise, rather than directly returning a value. This means that whether an async function is used to start or continue a Promise chain, the shape can be the same.

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.