Run Promises in Parallel

To run multiple promises in series, pass an array of promises to Promise.all(). The first one to resolve will be passed to the callback.

js
1async function updateUserInfo() {
2 await Promise.all([
3 updateUserName({ id: 1, name: 'Clown 🤡' }),
4 sendUpdateNotification({ id: 1 }),
5 cleanupOldLogs({ id: 1, cleanAll: true }),
6 ]);
7}