JavaScript & TypeScript Typing Practice
Modern JS is symbol soup: =>, ?., ??, ${...}, spread dots, and generics. Build muscle memory on real snippets instead of fumbling them mid-thought.
What you'll be typing
const result = arr.map(x => x * 2);
const { name, age } = user;
const value = obj?.nested?.deep ?? fallback;
useEffect(() => { return () => cleanup(); }, [dep]);
// TODO: handle empty response from the API
Why JS deserves its own drills
- Arrow functions and chains —
=> dozens of times a day, plus .filter().map().reduce()
- Template literals — backticks and
${ live in awkward corners of the keyboard
- Destructuring and spread —
{ ...rest }, [a, b], defaults
- TypeScript syntax — generics, type annotations, interfaces
- Comments included —
// and /* */ are real typing too
Prefer another language? Python, Go, Rust, or the programmer typing guide.