Fill: Conditional Type
Fill in the Blank Medium
Question
Fill in the blank to complete the conditional type:
Code
type IsString<T> = T ___ string ? true : false;
Hint
Conditional types use the extends keyword to check type relationships.
Explanation
The keyword is extends. The conditional type T extends string ? true : false checks if T is assignable to string. If yes, the type resolves to true; otherwise false. This is the foundation of type-level programming.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.