← Back to archive

Stdle #57 · generics · 2026-08-02

What does this TypeScript snippet output?

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

function id<T>(x: T): T { return x }
console.log(typeof id<number>)
Generics
4 attempts left

Answer & explanation