Async & Await / Promises
Async
Main function
(async () => {
throw new Error('Hello World');
})().catch((err) => console.error(err));With Promises
async () => {
await new Promise(...);
const [
result1,
result2,
] = await Promise.all([
new Promise(),
new Promise(...)],
);
return value;
}Promises
PromisesPromise.all
Last updated