wtfjavascript
v0.2.1
Published
WTF, JavaScript?! — 150+ advanced JavaScript challenges in your terminal: coercion nightmares, closures, proxies, sorting algorithms, interview classics, and more. Companion CLI for wtfjavascript.dev
Maintainers
Readme
wtfjavascript
WTF, JavaScript?! — 150+ advanced JavaScript challenges in your terminal.
Coercion nightmares ([] == ![], the == algorithm, c == 1 && c == 2 && c == 3), closures and higher-order functions, Proxy traps, floating-point money math, sorting algorithms, BFS/DFS, LeetCode-style interview classics, and brutal "what does this log?" quizzes — each with a hint naming the exact method to reach for, judged locally in a sandbox.
Install
npm install -g wtfjavascript
# or with Bun (same registry, fully supported — the sandbox judge runs under Bun too)
bun add -g wtfjavascript
# or zero-install
npx wtfjavascript
bunx wtfjavascriptPlay
wtfjs # randomized exam (8 challenges)
wtfjs --count 5 # shorter run
wtfjs --topic "Proxy & Reflect" # single topic
wtfjs --list # list every challenge
wtfjs --server https://wtfjavascript.dev # record your run on the leaderboardCoding challenges open your own $EDITOR — write the solution, save, close, and the judge runs the hidden tests plus source constraints (e.g. must use .some(), no temp variable). r dry-runs your code and shows console.log output without spending a try; h reveals the hint.
Zero dependencies — plain Node.js (≥18).
The full experience
The web app at wtfjavascript.dev has the same challenge bank with a CodeMirror editor, drag-and-drop ordering problems, animated visuals, exam mode, and a persistent leaderboard.
