← Back to archive

Stdle #96 · classes · 2026-09-10

What does this TypeScript snippet output?

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

class Counter {
static #n = 0;
static { Counter.#n = 5; }
static get value() { return Counter.#n; }
}
console.log(Counter.value);
Classes
4 attempts left

Answer & explanation