← Back to archive

Stdle #164 · scope · 2026-11-11

What does this JavaScript snippet output?

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

function snapshot(x) {
return () => x;
}
const fns = [snapshot(1), snapshot(2)];
let x = 99;
console.log(fns[0](), fns[1]());
Scope
4 attempts left

Answer & explanation