What is TypeScript?
TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. It adds optional static typing and class-based object-oriented programming.
Why TypeScript?
- Catch errors early: Find bugs at compile time, not runtime
- Better tooling: Improved autocomplete, refactoring, and navigation
- Self-documenting: Types serve as documentation
- Scalable: Easier to maintain large codebases
Your First TypeScript Program
Type Annotations
In TypeScript, you can add type annotations to variables:
Compilation
TypeScript compiles to JavaScript. Click "Show JS" to see the output:
The types are removed during compilation - they're only for development!
Exercise: Add Types
Add type annotations to the variables:

