Skip to main content

JavaScript Question 45

Question 45 of 0JavaScript

What does this return?

Login Required

Please login to select answers and solve this question. You can view the question without logging in.

Code:
const firstPromise = new Promise((res, rej) => {
  setTimeout(res, 500, 'one');
});

const secondPromise = new Promise((res, rej) => {
  setTimeout(res, 100, 'two');
});

Promise.race([firstPromise, secondPromise]).then(res => console.log(res));

Select the correct option: