🔍 Overview
Chapter 2 explores the fundamental building blocks of type systems—basic types. These include primitive types like numbers, strings, and booleans, as well as more structured types like tuples and enums.
💡 Key Concepts
- Primitive Types: Covers number, string, boolean, null, undefined, and symbol.
- Literal Types: Introduces fixed values as types, such as `"yes"` or `42`.
- Union Types: Explains how to combine multiple types using the `|` operator.
- Tuple Types: Describes ordered collections with fixed types and lengths.
- Enum Types: Shows how to define named constants for better readability and safety.
- Type Aliases: Demonstrates how to create reusable type definitions using `type`.
🧭 Takeaway
Mastering basic types is essential for writing expressive and safe TypeScript code. They form the foundation for more advanced type constructs and help encode intent directly into the type system.