Video wird geladen...
Video konnte nicht geladen werden
I STILL get so many folks misunderstanding the difference between: Pick, Omit Exclude, Extract They should be called: PickFromObject, OmitFromObject ExcludeFromUnion, ExtractFromUnion Here's a breakdown:
32,246 Aufrufe • vor 1 Jahr •via X (Twitter)
10 Kommentare

Here's my course - it's 30% off right now

I always end up copy/pasting the stricter version in my projects and never use the original one: export type OmitStrict<T, K extends keyof T> = Omit<T, K> export type PickStrict<T, K extends keyof T> = Pick<T, K>

Pick is already strict, FYI

You're right!

I can recommend an interactive article about difference between Pick and Omit

🙋♂️ type Album = { // ... artist: string // ... } what's diff between 1. Pick<Album, 'artist'> 2. Album['artist'] thanks 🙏

type Album = { artist: string }; Album['artist']; // string Pick<Album, 'artist'>; // { artist: string }

Nah mate, too many characters

It's only me in the video

It's a weird multi-level almost set-like thing that syntax... would love to see something cleaner, at least that's my current understanding.

