← Back to archive

Stdle #74 · modern · 2026-08-19

What does this TypeScript snippet output?

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

const t: readonly number[] = [1, 2, 3];
const sorted = [...t].sort((a, b) => b - a);
console.log(sorted[0], t[0]);
Modern
4 attempts left

Answer & explanation