← Back to archive

Stdle #13 · generics · 2026-06-19

What does this TypeScript snippet output?

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

function w(this: number[], x: number) { return this.length + x }
console.log(w.call([1, 2], 3))
Generics
4 attempts left

Answer & explanation