DEV Community

Discussion on: Static Typing or Typescript

Collapse
 
peerreynders profile image
peerreynders

In situations where a function is dealing with a parametric type (generics) but it isn't interacting with the actual type value it's sometimes useful to use unknown as a type value.

Furthermore you typically narrow types with type assertions, user-defined type guards or assertion functions.