Course contentsShow
TypeScript
Lesson 201 of 1,7965. Type Narrowing FundamentalsPro lesson

Non-null Assertion with Truthiness

Using if (x) to narrow string | null to string, and the pitfalls when empty string is valid.

This lesson is for subscribers

You've completed the free preview. Subscribe to unlock every lesson in every course.