← Back to archive

Stdle #73 · scope · 2026-08-12

What does this JavaScript snippet output?

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

var out = [];
for (var i = 0; i < 3; i++) { (function (j) { out.push(j); })(i); }
console.log(out.join(""));
Scope
4 attempts left

Answer & explanation