← Back to archive

Stdle #71 · scope · 2026-08-10

What does this JavaScript snippet output?

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

const x = (function () { return 1; })() + (function () { return 2; })();
console.log(x);
Scope
4 attempts left

Answer & explanation