← Back to archive

Stdle #84 · scope · 2026-08-23

What does this JavaScript snippet output?

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

const o = {};
Object.defineProperty(o, "x", { value: 1, enumerable: false });
Object.defineProperty(o, "y", { value: 2, enumerable: true });
console.log(JSON.stringify({ ...o }));
Scope
4 attempts left

Answer & explanation