What is the difference between `Extract` and `Exclude`?

TypeScript Professional Hard

TypeScript Professional — Hard

What is the difference between `Extract` and `Exclude`?

Key points

  • Extract keeps types that can be assigned to U
  • Exclude removes types that can be be assigned to U
  • Understanding the direction of filtering is key

Ready to go further?

Related questions