Skip navigation
I STILL get so many folks misunderstanding the difference between:
0:00 / 3:54

I STILL get so many folks misunderstanding the difference between:

Matt Pocock

@mattpocockuk250K followers

Visit on X
608 likesDownloadOriginal post

32,246 views

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:

10 Comments

Comments from the original post on X (Twitter)

  • Matt Pocock's profile picture

    @mattpocockuk

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

    3 likes

  • Théo LUDWIG's profile picture

    @theoludwig_

    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>

    3 likes

  • Matt Pocock's profile picture

    @mattpocockuk

    Pick is already strict, FYI

    4 likes

  • Shelton Louis's profile picture

    @SheltonLouisX

    You're right!

    2 likes

  • onurhan's profile picture

    @Onurhan1337

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

    2 likes

  • Jacky Hu's profile picture

    @ChiahauHu

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

    1 like

  • Matt Pocock's profile picture

    @mattpocockuk

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

    6 likes

  • marc niclas's profile picture

    @niclas_hermann

    Nah mate, too many characters

    1 like

  • Matt Pocock's profile picture

    @mattpocockuk

    It's only me in the video

    11 likes

  • Suumiboor's profile picture

    @suumiboor

    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.