← Back to archive

Stdle #158 · modern · 2026-11-11

What does this TypeScript snippet output?

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

const t = [10, 20] as const;
const a = t as unknown as number[];
a.length = 0;
console.log(t.length, JSON.stringify(t));
Modern
4 attempts left

Answer & explanation