What does ‘co-variance’ mean for function return types in TypeScript?

TypeScript Associate Hard

TypeScript Associate — Hard

What does ‘co-variance’ mean for function return types in TypeScript?

Key points

  • Co-variance allows assigning functions returning subtypes to variables with supertype return types
  • It provides flexibility in function assignments based on return types
  • Co-variance is specific to return types, not parameter types

Ready to go further?

Related questions