TypeScript Concepts: A Complete Reference

Master the fundamentals of TypeScript with our comprehensive library of concept guides. Whether you’re just starting out or looking to deepen your understanding, this page features clear, beginner-friendly explanations of core TypeScript topics like generics, types, interfaces, type guards, and more. Each article breaks down complex ideas with practical examples, helping you write safer, more robust TypeScript code. Browse the topics below to build your TypeScript expertise, one concept at a time.

Requirements Legend

When a topic is stated as requirement, familiarity with the concepts listed below is required.

Arrays
JavaScript arrays, their methods, and techniques for manipulation
Functions
JavaScript functions, including parameters, return types, and signatures
Objects
JavaScript objects, property access, and manipulation
Generics
Type parameters that allow components to work with multiple data types
| Unions
Types allowing a value to be one of multiple specified types (e.g., `string | number`)
Intersections
Types combining multiple types into one (e.g., `{ name: string } & { age: number }`)
Mapped Types
Types that create new variations by transforming the properties of existing ones
Utility Types
Built-in helpers like Partial, Required, and Pick for common type transformations
Recursive Types
Types that reference themselves to model nested or self-similar structures
Type Guards
Runtime checks that narrow a variable’s type within conditional logic
? Conditional Types
Types that choose between outcomes based on a compile-time condition
TypeScript Generics
Learn how to use TypeScript generics to write flexible yet type safe code — type parameters, constraints, defaults, and inference with clear examples.
Requirements::FunctionsArraysObjects
Mapped Types
Learn how to use TypeScript mapped types to transform object shapes. Covers Partial, Required, Record, and custom mapped types with real-world examples.
Requirements::GenericsObjects
TypeScript Function Types
A practical guide to the TypeScript function type: arrow syntax, call signatures, overloads, generic signatures, and the void and variance gotchas.
Requirements::FunctionsObjectsGenerics
TypeScript typeof
Learn how the TypeScript typeof operator extracts types from values, how it differs from JavaScript typeof, and how to combine it with keyof, as const, ReturnType, and Parameters.
Requirements::FunctionsObjects| Unions
TypeScript satisfies Operator
How the TypeScript satisfies operator checks a value against a type without widening it, how it differs from as and annotations, and when to reach for it.
Requirements::Objects| UnionsGenerics
Interfaces
Learn the TypeScript interface: object shapes, extending, optional and readonly fields, index signatures, call signatures, and when to use a type instead.
Requirements::FunctionsObjects
Union Types
Understand TypeScript union types and how to use them for flexible, type-safe code. Covers narrowing, discriminated unions, and common patterns.
Requirements::FunctionsArraysObjects
Intersection Types
Learn how TypeScript intersection types combine types into one, the four types of intersections, and the pitfalls that quietly produce never.
Requirements::FunctionsObjects| Unions
TypeScript Enums
JavaScript has no enum keyword. Learn what a JavaScript enum really means, how TypeScript enums work, and the as const pattern to use instead.
Requirements::FunctionsObjects| Unions
TypeScript Tuples
A guide to the TypeScript tuple: why JavaScript has no tuple type, how to fake one in plain JS, and how labeled, readonly and variadic tuples work.
Requirements::ArraysFunctions| Unions
TypeScript Discriminated Unions
How a TypeScript discriminated union works: picking a discriminant, narrowing with switch, exhaustiveness checks with never, and the patterns that make optional-property soup disappear.
Requirements::| UnionsObjectsFunctions
TypeScript Record
A practical guide to the TypeScript Record type: how Record<K, V> maps keys to values, why it beats a loose index signature, and the exhaustiveness and lookup gotchas to watch for.
Requirements::ObjectsGenerics| Unions
TypeScript Utility Types
A practical guide to TypeScript utility types: Partial, Pick, Omit, Record, Exclude, ReturnType and Awaited, how they are built, and the gotchas.
Requirements::GenericsObjects| Unions
TypeScript Omit
A practical guide to the TypeScript Omit type: how Omit<T, K> removes keys, why it will not catch your typos, and how it differs from Exclude and Pick.
Requirements::ObjectsGenerics| Unions
The JavaScript Spread Operator in TypeScript
A practical guide to the JavaScript spread operator and what TypeScript does with it: inferred types, object spread precedence, why spreading into a function call needs a tuple, as const, readonly arrays, and the shallow-copy trap.
Requirements::ArraysObjectsFunctions
flatMap in TypeScript
How flatMap works in TypeScript — the generic signature, one-level flattening, flat() with a depth literal, and using flatMap as a type-narrowing filter.
Requirements::ArraysFunctions| Unions
Promise.all in TypeScript
How Promise.all is typed in TypeScript: tuple inference, why arrays widen to a union, unknown in catch, and narrowing allSettled results.
Requirements::GenericsArrays| Unions
What Is a .tsx File?
What a .tsx file is, how it differs from .ts and .jsx, which tsconfig jsx setting to pick, and the generic arrow function gotcha.
Requirements::FunctionsGenericsObjects
TypeScript Classes
Learn the TypeScript class: fields, constructors, access modifiers, readonly, static, abstract, generics — and when a plain function is the better call.
Requirements::FunctionsObjectsGenerics
Template Literal Types
Learn to use TypeScript template literal types to build string types from existing types. Patterns for event names, CSS properties, and API route paths.
Requirements::Generics| UnionsMapped Types