List of questions
Related questions
Question 67 - Certified JavaScript Developer I discussion
Refer to the code below:
Let car1 = new Promise((_ , reject) =>
setTimeout(reject, 2000, "car 1 crashed in" =>
Let car2 =new Promise(resolve => setTimeout(resolve, 1500, "car 2 completed")
Let car3 =new Promise(resolve => setTimeout(resolve, 3000, "car 3 completed")
Promise.race(( car1, car2, car3))
.then (value => (
Let result = '$(value) the race.';)}
.catch(arr => {
console.log("Race is cancelled.", err);
});
What is the value of result when Promise.race executes?
A.
Car 3 completes the race
B.
Car 2 completed the race.
C.
Car 1 crashed in the race.
D.
Race is cancelled.
Your answer:
0 comments
Sorted by
Leave a comment first