Lesson 05

From TypeScript to JavaScript

Browsers only understand JavaScript — so TypeScript gets translated into plain JavaScript before it runs.

From TypeScript to JavaScript — illustrated
PLAINA tool called the compiler translates your TypeScript into plain JavaScript. In that one step it checks every type label for mistakes, then deletes the labels (the finished JavaScript doesn't need them). What ships and runs is ordinary JavaScript.
A LEVEL DEEPERThis step is called compiling (or “building”), and it's where a type error stops you — before anything ships. Picture a strict proofreader: you write the annotated draft, it checks it and prints a clean copy, and the browser only ever sees the clean copy. The model in one line: write in TypeScript, ship JavaScript.
← Back