Skip to content

Describe TypeScript essentials and shortcomings #4

@danieldietrich

Description

@danieldietrich

Essentials:

  • Universal types: any vs unknown vs never
  • naked parameter types
  • union A | B vs intersection A & B
  • distributed conditional types
  • parameters in covariant / contravariant / invariant position
  • difference between Keys<T> and keyof T for T in any | unknown | never
  • ...

Shortcomings:

  • UnionToTuple has an unpredictable order, see this tweet, but it is still the only way to recursively process elements.
  • ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✍️ doc... is more precious than code!

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions