What I mean is what happens if your promises reject?
David Griver
11

reject works in a similar way as does throw . They will both end up in your catch block.

Also, remember that async / await is just syntactical sugar.

Whilst you’d chain Promises like this on ES6:

myPromise.then(() => …).catch((error) => …))

You use try — catch blocks with async / await.

try {
const result = await myPromise;
// …
} catch (error) {
// …
}
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.