What does the Exclude utility type do?

TypeScript Associate Hard

TypeScript Associate — Hard

What does the Exclude utility type do?

Key points

  • Exclude utility type removes union members from T that are assignable to U
  • It creates a new type by filtering out compatible members
  • The resulting type will only contain members that are not part of U

Ready to go further?

Related questions