What does this program print?

from Error handling
Node 24 intermediate 2 min

What does this program print?

JavaScript
function outcome() {
  try {
    throw new Error('payment failed');
  } catch {
    return 'recovered';
  } finally {
    return 'cleanup';
  }
}

console.log(outcome());
Open in playground
Report an error