What is the difference between ‘interface extends’ and intersection types for object composition?

TypeScript Associate Hard

TypeScript Associate — Hard

What is the difference between ‘interface extends’ and intersection types for object composition?

Key points

  • Interface extends is specific to object types and supports declaration merging
  • Intersection types are more flexible but cannot be merged
  • Understanding this difference is essential for object composition in TypeScript

Ready to go further?

Related questions