In TypeScript, function parameters are checked bivariantly by default for method declarations. What does this mean?

TypeScript Professional Hard

TypeScript Professional — Hard

In TypeScript, function parameters are checked bivariantly by default for method declarations. What does this mean?

Key points

  • TypeScript's bivariant checking allows for both covariance and contravariance
  • Parameters can be supertypes or subtypes
  • Provides flexibility in method declarations

Ready to go further?

Related questions