All Promise.race() does it report to the caller which of the promises you passed it resolved/rejected first. It does not affect whether they resolve/reject and does not stop the other promises from resolving after the first one has resolved. The operations in those other promises still keep going and they have whatever outcome they would have, regardless of using Promise.race().
Look at this example which you can run right in the snippet:
function resolveMs(ms) {
return new Promise(resolve => {
setTimeout(() => {
console.log(`resolveMs(${ms}) resolving`);
resolve(ms);
}, ms);
});
}
console.log('Starting...');
Promise.race([resolveMs(100), resolveMs(50), resolveMs(200)]).then(result => {
console.log(`Final result: ${result}`);
});
That generates this output:
resolveMs(50) resolving
Final result: 50
resolveMs(100) resolving
resolveMs(200) resolving
There you can clearly see that all three promises resolve on their expected schedule. Promise.race() itself resolves when the first of the three promises you passed it resolve, but that does not affect the other two operations. They keep doing what they were doing.
You can think of it like an 800m running race. Promise.race() reports the winner of the race (that is its job), but just because there's a winner, the other participants don't stop running. They still finish the race too in whatever time they would have if they ran on their own.
If you want the other operations to somehow stop when the first resolves, you'd have to manually code things so that you cancelled the other two operations and they would have to represent operations that are cancellable as there is no automatic, built-in mechanism for stopping asynchronous operations that are already underway. In my example above, one would have to call clearTimeout() on the remaining timers (and you would have to save the timerID values somewhere so you could call clearTimeout() on them).