TypeScript

JavaScript with superpowers

100% free · no signup to read 8 chapters Programming language

Created

2012 by Anders Hejlsberg at Microsoft

Type

Static, compiled to JavaScript

Current version

TypeScript 5.4 (2024)

Powers

Angular, VS Code, Deno, large codebases

npm downloads

90M+ weekly

vs JavaScript

Adds types — catches bugs at compile time

File extension

.ts / .tsx

Best for

Large web apps, APIs, any JS project

What is TypeScript?

TypeScript is a superset of JavaScript that adds static type checking. Every valid JavaScript file is also a valid TypeScript file — but TypeScript lets you describe the shape of your data so the editor and compiler catch mistakes early.

Why TypeScript?

TypeScript catches bugs at compile time instead of runtime. For small scripts it's optional; for large applications it's essential.

Feature TypeScript JavaScript Flow
Type checking ✅ Static ❌ Dynamic ✅ Static
IDE support Excellent Good Good
Compilation step Yes (.ts → .js) No Yes
Learning curve Medium (just add types) Easy Medium
Job market Growing fast Largest Declining

What you'll learn

Chapter What you'll know
Introduction What TypeScript is, why it exists
Types Primitives, arrays, tuples, enums
Interfaces Object shapes, type aliases
Functions Parameter types, overloads
Classes Access modifiers, inheritance
Generics Type parameters, constraints
Modules Imports, exports, namespaces
Unions Discriminated unions, narrowing

Start with introduction.