What is the difference between ‘type’ and ‘interface’ when extending other types?

TypeScript Professional Medium

TypeScript Professional — Medium

What is the difference between ‘type’ and ‘interface’ when extending other types?

Key points

  • Interfaces use 'extends' and support declaration merging
  • Type aliases use '&' for composition and cannot be merged
  • Understanding this difference is crucial for proper type extension in TypeScript

Ready to go further?

Related questions