TypeScript vs JavaScript
A superset, not a replacement — TypeScript compiles down to plain JavaScript
TypeScript is a typed superset of JavaScript — every valid JavaScript file is already valid TypeScript. What TypeScript adds is a static type system that catches whole classes of bugs (wrong argument types, typos on object properties, unhandled null values) before the code ever runs, rather than as a runtime surprise.
Because TypeScript compiles down to plain JavaScript, it runs anywhere JavaScript already runs — the browser, Node.js, or any JS runtime — and interoperates directly with existing JavaScript libraries, with or without type definitions.
The tradeoff is a build step: TypeScript needs to be compiled (typically with tsc) before it runs, though tools like ts-node let you execute it directly during development.
The TypeScript Roadmap
Work through these in order, from setup to the advanced type system
TypeScript Basics
Get TypeScript installed, configured, and running before touching the type system.
TypeScript Types
The vocabulary of the type system — from primitives to the types at the very top and bottom.
Assertions & Type Inference
Tell the compiler what you know, and understand what it can already infer on its own.
Combining Types
Build new types out of existing ones instead of repeating yourself.
Type Guards / Narrowing
Help the compiler narrow a broad type down to something specific within a branch of code.
TypeScript Functions
Type parameters and return values, and handle functions with more than one valid signature.
TypeScript Interfaces
Describe the shape of an object — and know when to reach for an interface over a type alias.
Classes
Bring object-oriented patterns to TypeScript with full type checking on top.
Generics
Write reusable, type-safe code that works across many types instead of just one.
Utility Types & Decorators
Built-in helpers that transform existing types, plus metadata annotations for classes.
Advanced Types
Where TypeScript's type system stops describing data and starts computing with it.
Modules & Ecosystem
Organize code across files, and the tooling that keeps a TypeScript codebase consistent.
GitHub Projects
Real, buildable projects to put on your own GitHub
TypeScript Compiler Source
Browse the official TypeScript compiler source to see how type checking, inference, and narrowing are actually implemented.
type-fest Utility Library
Study a large collection of advanced utility types to see mapped, conditional, and template literal types used in practice.
Write a DefinitelyTyped Package
Pick an untyped JavaScript package and write its type declarations for DefinitelyTyped — a real-world exercise in interfaces and modules.
Type Challenges
Work through community type-system puzzles ranging from easy to extreme — a focused way to master generics and conditional types.
Frequently Asked Questions
Common questions from people starting out with TypeScript
Do I need to learn JavaScript before TypeScript?
Yes — TypeScript is a superset of JavaScript, so its syntax, runtime behavior, and ecosystem are all built directly on JavaScript. A solid grasp of JavaScript fundamentals makes the type system click much faster.
What's the difference between types and interfaces?
Interfaces are generally used to describe the shape of objects and can be extended or merged across declarations, while type aliases can describe any type — including unions, primitives, and tuples — but can't be reopened once declared. In most everyday cases the two are interchangeable.
Does TypeScript run directly, or does it need to be compiled?
TypeScript is compiled down to plain JavaScript before it runs — typically with the tsc compiler. Tools like ts-node compile and run it in one step during development, which is convenient but still involves that same compilation under the hood.
What is type narrowing?
Narrowing is how TypeScript refines a broad type — like a union — down to a more specific one within a branch of code, based on checks such as typeof, instanceof, or a custom type predicate function.
What are utility types for?
Utility types like Partial, Pick, and Omit let you derive a new type from an existing one instead of redefining it from scratch — useful for things like optional update payloads or trimmed-down API response shapes.
Is TypeScript worth it for small projects?
It depends on how long the project will live and how many people will touch it. The type system pays off most on codebases that grow, get refactored, or are shared across a team — for a quick throwaway script, plain JavaScript is often simpler.
Track complete
From tsconfig and primitive types to generics, advanced types, and modules — that's the core of what's expected of any TypeScript developer. Keep building, and put it to work in a real frontend or backend project.
Where next?
Keep exploring by domain or drill into a single skill