Stdle #151 · modern · 2026-11-04
A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
1enum Size { S, M, L }2const arr = Object.values(Size).filter((v) => typeof v === "number");3console.log(arr.length);
Console output
Why
Because numeric enums build a two-way mapping, Object.values returns six entries: the three member names (strings) and the three numeric values. Filtering by typeof number isolates the three numbers, giving length 3.