← Back to archive

Stdle #100 · generics · 2026-09-14

What does this TypeScript snippet output?

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

function du<T = string>(x = 'd') { return x }
console.log(du(undefined))
Generics
4 attempts left

Answer & explanation