$ ./guess_the_languageProblem Solving — predict the output
Problem Solving — predict the output · hard · #115

What is the output?

function f() {
  try { return 1; } finally { return 2; }
}
console.log(f());
  1. 2
  2. 1
  3. undefined
  4. SyntaxError
A return inside finally overrides the one from try.
Play Problem Solving ▸