Ways to use Exclude in TypeScript by Matt Pocock
Link to blog: 9 ways to use Exclude in TypeScript by Matt Pocock
This blog is really useful for sharing and using the Exclude
type helper in TypeScript.
Remove a member of a union
The first argument represents the full union. The second argument can be any type even if it does not exist.
Remove multiple members from a union
We can also use Exclude to remove multiple members from a union. By passing a union to the second argument, we can remove multiple members at once.
These are the two examples which I believe can be used quite often. There are 7 more ways we can use the Exclude
helper as shared in his blog.