Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumJavaScriptPromise.all race allSettledSingle-choice MCQ

What does `Promise.race` do when the first-settling input rejects?

const fast = new Promise((_, rej) => setTimeout(() => rej('fast-fail'), 10)); const slow = new Promise(res => setTimeout(() => res('slow-ok'), 50)); Promise.race([fast, slow]).then( v => console.log('then', v), e => console.log('catch', e) );