TypeScript Professional — Hard
Key points
- `asserts` keyword narrows the type based on the assertion function
- Only narrows the type if the function does not throw an error
- Limited to the current scope of the code block
Ready to go further?
Related questions
