Promise.race() returns the first promise to settle, whether it fulfills or rejects.
Promise.race([
fetchFromServer1(),
fetchFromServer2()
]).then(result => {
// First response wins
});
Useful for timeouts: race your operation against a timeout promise.