← Back to archive

Stdle #30 · classes · 2026-07-06

What does this TypeScript snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

class C {
static status = '';
static {
try { throw new Error('x'); } catch { C.status = 'caught'; }
}
}
console.log(C.status);
Classes
4 attempts left

Answer & explanation