Web Frontend Magic Quiz

Test your knowledge of Web Frontend by answering this quiz!
Question about ES6 Async/Await

Given the following code:

async function A() {
  try {
    const value = await someFunc1();
    return value;
  } catch (err) {
    // do something
  }
}

async function B() {
  try {
    const value = await someFunc2();
    return value;
  } catch (err) {
    // do something
  }
}

const values = Promise.all([A(), B()])

Which of the 2 methods will return first?


  • A(), since it was called first.
  • B(), since the promises execute in a LIFO order.
  • Neither, the code will error.
  • It is impossible to know.
How do you stack up?
My Progress
Percentage of Total Answers Correct
0 / 0
0%

Breakdown by Tag
0 / 0
0%
0 / 0
0%
Not sure about the answer? Check out:
ES6 Async/AwaitLast updated today