---
tags:
  - Programming_Languages
  - typescript
---

Type narrowing is the process of working out from a supertype like any or unknown what type the value should be in the x course of your code. Related to this is type guarding: ensuring that a value is of the suitable type as a factor of control flow. For instance using typeof to ensure that an input is numerical before proceeding with a function's logic.
