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

Two promises are passed to `Promise.race`. What is logged?

const a = new Promise((res) => setTimeout(() => res('a'), 100)); const b = new Promise((_, rej) => setTimeout(() => rej('b-err'), 50)); Promise.race([a, b]) .then((v) => console.log('then', v)) .catch((e) => console.log('catch', e));