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

Using typeof to Guard Primitives

How TypeScript narrows string | number unions when you check typeof x === 'string'.

This lesson is for subscribers

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