ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 67 - Certified JavaScript Developer I discussion

Report
Export

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
Answers
A.
Car 3 completes the race
B.
Car 2 completed the race.
Answers
B.
Car 2 completed the race.
C.
Car 1 crashed in the race.
Answers
C.
Car 1 crashed in the race.
D.
Race is cancelled.
Answers
D.
Race is cancelled.
Suggested answer: B
asked 23/09/2024
HNO Oo
39 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first