What does the ‘override’ keyword enforce in TypeScript 4.3+?

TypeScript Associate Hard

TypeScript Associate — Hard

What does the ‘override’ keyword enforce in TypeScript 4.3+?

Key points

  • 'override' keyword ensures existence of parent method
  • Compile error if parent method is renamed or removed
  • Prevents accidental method hiding in subclasses
  • Promotes code stability and maintainability

Ready to go further?

Related questions