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
39. The infer Keyword
Extracting types within conditional expressions.
Write `UnwrapPromise<T>` that gets `U` from `Promise<U>`.
Required in your answer:
infer U
Reveal solution
Run & check
Reset
Transpiled, then run in a sandbox
type UnwrapPromise<T> = any; // TODO
Output appears here.
← 38. Conditional Types
40. Recursive Types →