beraliv

Omit type under the hood in TypeScript

Example of Omit use
Example of Omit use

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:

Pick solution
Pick solution

We also need to exclude specified keys. That was in one of the challenges too:

Exclude solution
Exclude solution

We pick only those keys which are not excluded, let's use them together:

Solution
Solution

As usual, put the solution in Playground

Have a nice day 🌤

typescript

Comments

Alexey Berezin profile image

Written by Alexey Berezin who loves London 🏴󠁧󠁢󠁥󠁮󠁧󠁿, players ⏯ and TypeScript 🦺 Follow me on Twitter