Type System Foundations
This section covers the relationships TypeScript uses to infer, compare, narrow, and assign types. Every lesson stands alone while fitting the beginner-to-staff progression.
Learning outcomes
- Explain runtime and compile-time responsibilities.
- Write a correct example without unsafe escape hatches.
- Diagnose a representative compiler error.
- Identify API, performance, security, and production trade-offs.
- Apply the concept in a project or interview.
Lessons
- What Is a Type?
- Type Inference
- Type Annotations
- Contextual Typing
- Structural Typing
- Nominal vs Structural Types
- Assignability
- Compatibility
- Subtyping
- Widening
- Narrowing
- Freshness
- Soundness Trade-Offs
Study method
Run the examples under strict checking, intentionally introduce an error, explain the diagnostic, and finish the exercises.