← Back to archive

Stdle #35 · classes · 2026-07-11

What does this TypeScript snippet output?

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

const log: string[] = [];
class C {
static a = log.push('a');
static { log.push('block'); }
static b = log.push('b');
}
void C;
console.log(log.join(','));
Classes
4 attempts left

Answer & explanation