← Back to archive

Stdle #25 · modern · 2026-07-01

What does this TypeScript snippet output?

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

const o = { n: 1, m: 2 } as const;
let sum = 0;
for (const k of Object.keys(o)) sum += (o as any)[k];
console.log(sum);
Modern
4 attempts left

Answer & explanation