Skip to main content

Type Modifiers

Learning TypeScript's Type Modifiers chapter covers using type modifiers to take existing objects and/or types and turn them into new types:

  • Top types: the highly permissive any and the highly restrictive unknown
  • Type operators: using keyof to grab the keys of a type and/or typeof to grab the type of a value
  • Using—and when not to use—type assertions to sneakily change the type of a value
  • Narrowing types using as const assertions