The Problem Types Solve
What TypeScript is. JavaScript with type annotations, checked before the code runs and then removed.
Nothing survives into the output but the JavaScript you already know how to write. Types cost nothing at runtime, and they provide nothing at runtime either. Both halves of that sentence matter, and the second half is where most real TypeScript bugs come from.
✦ What it does not do
TypeScript catches shape mistakes, not logic mistakes. A function that returns the wrong number still returns a number, and the compiler is satisfied. It is a tool for one class of error, and it is very good at that class.
Mark this lesson complete
Your progress is saved on this device. No account needed.