Assertion Functions
This lesson gives more details about assertion functions.
We'll cover the following...
We'll cover the following...
The assertion function is new to TypeScript version 3.7. It aims to not only ensure that a value is of a specific type but also to throw at (runtime) an exception if it does not respect the expected type. The assertion function use cases are more oriented for a codebase that is coming from Javascript where asserting types was a common practice. With ...