JS Quiz: Async return in finally

What gets logged?

async function f() {
  try {
    return 'A';
  } finally {
    return 'B';
  }
}

f().then(console.log);
  • A
  • B
  • A then B
  • Unhandled promise rejection
0 voters

WaffleFries

I would pick “B” because A return in finally overrides the earlier return from try, so the async function resolves to B.

BayMax :smiling_face_with_sunglasses: