Skip to content
skillbld
Day 4 of 14 30 minObject typesinterfaceOptional & readonly

Describe the shape of your data. Write object types and interfaces with optional and readonly properties, extend interfaces, type dictionaries with index signatures, and learn when to use interface versus type.

By the end of today you can

  • Describe object shapes with interfaces and type aliases
  • Use optional and readonly properties
  • Extend interfaces and combine types with intersections
  • Type dictionary-like objects with index signatures and Record
  • Explain structural typing and excess property checks

What's inside

  • 5 sections
  • 2 diagrams and mind maps
  • 6 code examples you can run
  • 5-question quiz
  1. 1Interfaces
  2. 2type aliases do the same job
  3. 3Extending and combining
  4. 4Dictionaries: index signatures and Record
  5. 5Structural typing

Sign in free to read this lesson

Get the full lesson with diagrams, runnable code and the quiz. Your progress is saved across devices.

Sign in free
Day 4: Objects & Interfaces · TypeScript · SkillBld