← Back to archive

Stdle #16 · scope · 2026-06-16

What does this JavaScript snippet output?

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

function f() {
console.log(typeof x);
var x = 5;
}
f();
Scope
4 attempts left

Answer & explanation