Skip to main content

JavaScript Question 102

Question 102 of 0JavaScript

What's the value of output?

Login Required

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

Code:
const myPromise = () => Promise.resolve('I have resolved!');

function firstFunction() {
  myPromise().then(res => console.log(res));
  console.log('second');
}

async function secondFunction() {
  console.log(await myPromise());
  console.log('second');
}

firstFunction();
secondFunction();

Select the correct option: