Pre-Summer Sale Special Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: ac4s65

Refer to the code:01 let car1 = new Promise((_, reject) = >02 setTimeout(reject, 2000, "...

Refer to the code:

01 let car1 = new Promise((_, reject) = >

02 setTimeout(reject, 2000, " Car 1 crashed in " ));

03 let car2 = new Promise(resolve = >

04 setTimeout(resolve, 1500, " Car 2 completed " ));

05 let car3 = new Promise(resolve = >

06 setTimeout(resolve, 3000, " Car 3 completed " ));

07

08 Promise.race([car1, car2, car3])

09 .then(value = > {

10 let result = ' $(value) the race. ' ;

11 })

12 .catch(err = > {

13 console.log( " Race is cancelled. " , err);

14 });

What is the value of result when Promise.race executes?

A.

Car 2 completed the race.

B.

Car 3 completed the race.

C.

Race is cancelled.

D.

Car 1 crashed in the race.

JavaScript-Developer-I PDF/Engine
  • Printable Format
  • Value of Money
  • 100% Pass Assurance
  • Verified Answers
  • Researched by Industry Experts
  • Based on Real Exams Scenarios
  • 100% Real Questions
buy now JavaScript-Developer-I pdf
Get 65% Discount on All Products, Use Coupon: "ac4s65"