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 restrictiveunknown
- Type operators: using
keyof
to grab the keys of a type and/ortypeof
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