Loading homepage
Input: await promiseRace([Promise.resolve("first"), Promise.resolve("second")]) Output: "first"
Input: await promiseRace([new Promise(() => {}), "ready"]) Output: "ready"
Input: promiseRace([Promise.reject("failed"), Promise.resolve("ready")]).catch((reason) => reason) Output: "failed"
Input: promiseRace([]) Output: A Promise that stays pending
promiseRace(iterable) returns a Promise adopting the first input to fulfill or reject. Examples show awaited values or caught reasons rather than the Promise object itself.