How the TypeScript Extract Type Works

The Extract utility type lets us check a union type for specific members, and returns a new type based on what is leftover. It's quite similar in format to the Exclude type.

Let's find out how it works.