← Back to archive

Stdle #29 · erasure · 2026-07-05

What does this TypeScript snippet output?

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

const raw: unknown = { n: 1 }
const obj = raw as { n: number }
console.log(obj.n + obj.n)
Type Erasure
4 attempts left

Answer & explanation