New: We've launched a brand new Coding Challenges section! Check out these interactive, real-world exercises to level up your skills.Explore Challenges
FrontendPrep
TypeScript Quiz

Type Narrowing & Guards

Learn how to narrow types in TypeScript using typeof, instanceof, discriminated unions, type predicates, and exhaustiveness checks.

Question 1 of 100%

Given `function process(x: string | number)`, which condition correctly narrows `x` to `string`?