What does Extract return?

TypeScript Associate Hard

TypeScript Associate — Hard

What does Extract return?

Key points

  • Extract filters out incompatible types from T
  • Only union members of T that match U are returned
  • Helps ensure type compatibility in TypeScript

Ready to go further?

Related questions