Assertion Functions

This lesson talks about a new feature of TypeScript 3.7: the assertion function.

Asserting untyped code

In JavaScript, you must assert the variables’ type since it is not a typed language. While the assertion function is not something you would require using purely TypeScript, it is handy to know in case you have a transpilation error on assertion.

Get hands-on with 1400+ tech skills courses.