← Back to archive

Stdle #40 · modern · 2026-07-16

What does this TypeScript snippet output?

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

function tag(s: TemplateStringsArray, x: number): string {
return s[0] + x + s[1]
}
console.log(tag`a${2}b`)
Modern
4 attempts left

Answer & explanation