TypeScript Essentials
Type safety for production codebases. Structural typing, interfaces, unions, generics, utility types, and configuring TypeScript for maximum value.
Why TypeScript exists, how structural typing differs from nominal typing, and why duck typing is the foundation of the entire type system. The mental model that prevents 90% of TS confusion.
TypeScript's primitive types, arrays, objects, function signatures, and the type inference engine that means you rarely need to write types manually. How to annotate when you should and trust inference when you shouldn't.
When to use interface, when to use type, how extends differs from intersection, and the declaration merging behavior that makes interfaces uniquely powerful for library authors.
Union types for values that can be multiple types, discriminated unions for modeling state machines, and the narrowing patterns that make TypeScript's type system genuinely powerful.
How TypeScript tracks exact values through literal types, narrows unions via control flow analysis, and the const assertion that unlocks type-level string manipulation.
Generic functions and types that work with any shape while staying type-safe. Constraints with extends, default type parameters, and the patterns that make libraries like React and Zod possible.
Type-level if/else with conditional types, transforming object types with mapped types, and the keyof/in operators that make TypeScript's type system Turing-complete.
Build Partial, Required, Pick, Omit, Record, Exclude, Extract, ReturnType, and Parameters from primitives. Understanding the internals eliminates the mystery.
Custom type predicates with the is keyword, assertion functions with asserts, user-defined narrowing, and exhaustive pattern matching with never.
Every tsconfig strict flag explained with real examples of bugs each one catches. Why strict: true is non-negotiable in production, and the flags that matter beyond strict.
10 TypeScript snippets — predict whether each one compiles or produces a type error. Trace the type system step by step. Scoring above 8 means you've internalized TypeScript's rules.