The Promise any() static method takes an iterable of promises and returns a single Promise when any of the input's promises fulfills with its value. It rejects when all of the input's promises reject with an AggregateError containing an array of rejection reasons.
const promise1 = Promise.reject(0);
const promise2 = new Promise((resolve) => setTimeout(resolve, 100, 'quick'));
const promise3 = new Promise((resolve) => setTimeout(resolve, 500, 'slow'));
const promises = [promise1, promise2, promise3];
Promise.any(promises).then((value) => console.log(value));
// "quick"