Пропустить навигацию
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

@mattpocockuk250 тыс. подписчиков

Открыть в X
608 отметок «Нравится»СкачатьОригинальный пост

32 246 просмотров

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 комментариев

Комментарии из оригинального поста в X (Twitter)

  • Фото профиля Matt Pocock

    @mattpocockuk

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

    3 отметки «Нравится»

  • Фото профиля Théo LUDWIG

    @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 отметки «Нравится»

  • Фото профиля Matt Pocock

    @mattpocockuk

    Pick is already strict, FYI

    4 отметки «Нравится»

  • Фото профиля Shelton Louis

    @SheltonLouisX

    You're right!

    2 отметки «Нравится»

  • Фото профиля onurhan

    @Onurhan1337

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

    2 отметки «Нравится»

  • Фото профиля Jacky Hu

    @ChiahauHu

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

    1 отметка «Нравится»

  • Фото профиля Matt Pocock

    @mattpocockuk

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

    6 отметок «Нравится»

  • Фото профиля marc niclas

    @niclas_hermann

    Nah mate, too many characters

    1 отметка «Нравится»

  • Фото профиля Matt Pocock

    @mattpocockuk

    It's only me in the video

    11 отметок «Нравится»

  • Фото профиля Suumiboor

    @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.