Problem Statement
In type P<T> = T extends Promise<infer U> ? U : T, U is…
Explanation
The “infer U” captures whatever a Promise resolves to. If T is Promise<string>, U becomes string.
Code Solution
SolutionRead Only
type P<T> = T extends Promise<infer U> ? U : T; type A = P<Promise<'ok'>>; // 'ok' type B = P<number>; // number
