Valid JS-Dev-101 Dumps shared by EduDump.com for Helping Passing JS-Dev-101 Exam! EduDump.com now offer the newest JS-Dev-101 exam dumps, the EduDump.com JS-Dev-101 exam questions have been updated and answers have been corrected get the newest EduDump.com JS-Dev-101 dumps with Test Engine here:
Refer to the code below (assuming Promise.race is intended): let cat3 = new Promise(resolve => setTimeout(resolve, 3000, "Cat 3 completes") ); Promise.race([cat1, cat2, cat3]) .then(value => { let result = `${value} the race.`; }) .catch(err => { console.log("Race is cancelled:", err); }); (Assuming cat1 and cat2 are similar to earlier examples: cat2 resolves fastest.) What is the value of result when Promise.race executes?
Correct Answer: A
From earlier pattern (cars/cats race): One promise resolves the fastest with "Car 2 completed" (or analogous "Cat 2 completes"). Promise.race resolves with the first settled promise's value. In .then, value is "Car 2 completed" and: let result = `${value} the race.`; // "Car 2 completed the race." Thus result is "Car 2 completed the race." → option A. ________________________________________