Sascha Schulz
2023-10-24 4d46431f0a310f3fe2d74f54dd2b67340c1e68a2
1
2
3
4
5
6
7
const contestants = [
    new Promise((r) => setTimeout(() => r("a"), 1000)),
    new Promise((r) => setTimeout(() => r("b"), 1000)),
    new Promise((r) => setTimeout(() => r("c"), 1000))
];
 
(async () => console.log(await Promise.race(contestants)))();