"JavaScript scaled past what one person could hold in their head. TypeScript is the bookkeeping for that fact."
The thing JavaScript got wrong (and right)
JavaScript was designed in ten days in 1995. Brendan Eich's job was to make a browser scripting language that any programmer could pick up, that didn't punish you for being sloppy, that just ran. He succeeded. Twenty-five years later JavaScript runs every front-end on Earth, most back-ends, and most build pipelines for both. The thing that made it succeed — "it just runs" — is exactly the thing that broke at scale.
If you write 200 lines of JavaScript alone, the absence of types is liberating. If you write 200,000 lines of JavaScript with seven other engineers, the absence of types is a slow leak. You rename a function — three callers break in production at 2am. You change a return value from a string to a string-or-null — a UI component renders null as the text "null" — your CEO sees it on the demo. Every JavaScript codebase past a certain size has the same scar tissue.
TypeScript is the bookkeeping that catches those errors before they reach production. Not at runtime — at compile time, in the editor, before the code ever runs. The cost is upfront annotation work. The benefit is the entire class of "oh no, that's not what I thought it was" bugs disappearing.
What TypeScript actually is
TypeScript is JavaScript plus a static type system that erases at compile time. Read that sentence twice — it's the whole language in one line. "Plus a static type system" means types are checked before the code runs. "That erases at compile time" means the output is plain JavaScript, with the types stripped. There's no TypeScript runtime, no TypeScript VM, no TypeScript interpreter. The compiler is a build-time tool that produces JavaScript.
Anders Hejlsberg — who also designed C# at Microsoft, and Delphi/Turbo Pascal before that — led the original TypeScript design in 2012. The goal was conservative: don't replace JavaScript, augment it. Every valid JavaScript file is also a valid TypeScript file (rename .js to .ts, it compiles). The type system is layered on top, and at the bottom, it disappears.
The cost / benefit ledger
Why this Quest opens with this lesson
Every other lesson in this quest assumes you bought the trade. If you walked in skeptical ("why not just write JavaScript and be careful?"), you'd resent every annotation we ask you to write. So we open with the cost ledger. By lesson three you'll have run your first tsc and seen the error messages that make this whole thing worth it. By lesson six you'll be reading inference output that already knows what you meant. By track seventeen you'll open the cwkPippa frontend — 30,000 lines of TypeScript — and recognize every pattern by name. That's the bar.