Node.js: getting started

Lesson 03 · 11 min

async/await and Promise.all

Wait without blocking. Independent requests run in parallel.

An async function always returns a Promise, and await waits for it without blocking the thread. If three requests don't depend on each other, don't wait for them one by one: start them together with Promise.all. Catch errors with a plain try/catch.

Sign in to continue

The rest of this lesson opens after sign up

The first lesson of every course is open without an account. To read on, solve the practice and use Ask, create a free account or log in.