Yashotantra Academy
AI · Blockchain · Cloud · Data
Dark mode active
Learn
Tracks
ABCD
Certification
More
▾
Dark mode active
Learn
Tracks
ABCD
Certification
Study
Theory
Code Lab
Build
Solidity IDE
Staking Sandbox
Simulation
Reference
Wallets
Gas Fees
Explorers
← Code Lab
TypeScript
0/50 solved · 0%
All lessons
lesson
code
Generics · hard
38. Conditional Types
Types that depend on a condition.
Define `IsString<T>` that is `true` if `T` is `string`, else `false`.
Required in your answer:
T extends string
? true : false
Reveal solution
Run & check
Reset
Transpiled, then run in a sandbox
type IsString<T> = any; // TODO
Output appears here.
← 37. Generic Defaults
39. The infer Keyword →