cf.completefrontend

Predict the outputEasy

In what order do try, catch, and finally log when catch returns?

What does this log?
function test() {
  try {
    console.log("try");
    throw new Error("oops");
    console.log("after throw");
  } catch (error) {
    console.log("catch", error.message);
    return "from catch";
  } finally {
    console.log("finally");
  }
  console.log("after try");
}
 
console.log(test());

The answer

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

Checking your sign-in…