Omit type under the hood in TypeScript
Created: 21 Apr 2021Updated: 21 Apr 2021
Today we're talking about Omit.
First challenge was Pick under the hood where we discussed how Pick is working. Omit is the opposite of Pick: it excludes the keys we specify.
Combination of 2 challenges
First of all, we already learnt how to pick the keys we specify:
We also need to exclude specified keys. That was in one of the challenges too:
We pick only those keys which are not excluded, let's use them together:
As usual, put the solution in Playground
Have a nice day 🌤
typescript