Promise APIs

Promise.all([promise1, promise2]).then(...)

runs in parallel. Rejects as a whole is any promise rejects.

Promise.allSettled: waits for all promises to settle regardless of results

Promise.race: waits only for the first settled promised (resolve or reject)

Promise.any:waits only for the first resolved. If all reject, then rejects with AggregateError.

Next: Async await In JavaScript