TypeScript
From basic types to advanced generics and utility types.
Beginner
- What is TypeScript?: JavaScript with an extra layer that checks the *shape* of your data before your code ever runs.
- Basic Types: The small set of built-in labels TypeScript uses to describe strings, numbers, booleans, arrays, and fixed-shape lists.
- Interfaces: A named description of what properties an object must have, and what type each one holds.
- Type Aliases: Giving any type — not just object shapes — a reusable name.
- Functions with Types: Annotating a function's parameters and return value so TypeScript can check every call against them.
Intermediate
- Union & Intersection Types: Combining types with `|` to mean "one of these" and with `&` to mean "all of these, merged."
- Generics: Writing a function or type once so it works with whatever type you feed it, while still keeping that type checked.
- Enums: A named set of related constant values, grouped under one type so you can refer to them by name instead of a raw value.
- Type Narrowing: How TypeScript figures out, step by step, which specific branch of a union type you're actually holding at a given point in the code.
- Utility Types: Built-in generic types that transform an existing type into a new one, so you don't have to redefine similar shapes by hand.
- Classes & Access Modifiers: Marking a class's properties and methods as `public`, `private`, or `protected` to control what code outside the class is allowed to touch.
Advanced
- Mapped Types: Building a brand-new type by looping over every property of an existing type and transforming each one the same way.
- Conditional Types: A type that resolves to one of two different types, chosen based on a check performed entirely at compile time.
- Declaration Files (.d.ts): A file that describes the shape of existing JavaScript code, without containing any actual implementation, so TypeScript can check code that uses it.
- tsconfig & Strict Mode: The configuration file that controls how the TypeScript compiler behaves, and the single setting that turns on its strongest safety checks.