TypeScript

TypeScript is a typed superset of JavaScript developed by Microsoft. It adds static types, type inference, generics, interfaces, enums, and structural typing on top of standard JavaScript, then compiles down to plain JavaScript that runs in any JS engine. TypeScript is now the default for most professional JavaScript projects, web and server alike.

Why TypeScript spread

  • Editor experience. Autocomplete, navigation, and refactor that JavaScript editors could never match.
  • Catches bugs early. Many runtime errors (typos, wrong shape) become compile errors.
  • Refactoring. Renaming and restructuring large codebases becomes feasible.
  • Library typings. DefinitelyTyped and ambient declarations let most JS libraries be used with full types.
  • Type-driven APIs. Frameworks like FastAPI, tRPC, Prisma, Pydantic use types as the source of truth.

Notable features

  • Structural typing (duck typing at the type level)
  • Generics, conditional types, mapped types, template literal types
  • Strict null checks, no-implicit-any, exact optional property types
  • Project references, incremental builds, declaration files
  • The 2025-2026 TypeScript compiler is being rewritten in Rust for substantially faster compilation
🔗
Related Terms
JSX, React, Node.js, Deno, Bun.

Subscribe to Sahil's Playbook

Clear thinking on product, engineering, and building at scale. No noise. One email when there's something worth sharing.
[email protected]
Subscribe
Mastodon