cf.completefrontend

Predict the outputMedium

What happens when finally has its own return?

What does this log?
function first() {
  try {
    return "try";
  } finally {
    return "finally";
  }
}
 
function second() {
  try {
    throw new Error("lost");
  } finally {
    return "finally";
  }
}
 
console.log(first());
console.log(second());

The answer

Work out every line it logs, in order. Then check.

Checking your sign-in…