← Back to archive

Stdle #32 · scope · 2026-07-02

What does this JavaScript snippet output?

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

function f() {
try { console.log(y); let y = 1; }
catch (e) { console.log(e.constructor.name); }
}
f();
Scope
4 attempts left

Answer & explanation