Extending Interfaces

Extending Interfaces (🏁 solution)
πŸ‘¨β€πŸ’Ό Beautiful! Interface extension keeps your types DRY.
Interestingly, you can use intersections with interfaces as well:
type AuditLog = Timestamps & {
	action: string
	userId: string
}
πŸ¦‰ When to use extends vs intersection (&):
  • extends - Clear hierarchy, works with interfaces
  • & - Ad-hoc combinations, works with any types
Both achieve similar results, but because & works with both, it's recommended.

Please set the playground first

Loading "Extending Interfaces"
Loading "Extending Interfaces"