LESSON 1.1
Structural typing and assignability
Learn key techniques and workflows in TypeScript for Application Developers.
11m
intermediate
22,110 students
Overview
TypeScript compares shapes, not names. Two unrelated types are interchangeable if their members line up, which explains most surprising assignability errors.
In this lesson you will:
- Compare types by structure rather than declaration
- Read an assignability error from the mismatched member up
- Use branded types when structural compatibility is too loose
Pro Tip
Use caching and revalidation wisely to ensure your app stays fast and data remains fresh without unnecessary requests.