TypeScript · Middle · Question 8 of 75
What does Awaited<Promise<Promise<number>>> return?
- ✓Correct answer:
number - 2
Promise<number> - 3
Promise<Promise<number>>
Explanation
Awaited recursively unwraps promises and thenables, mirroring the behavior of await. Handy for an async function's result type: Awaited<ReturnType<typeof fetchUser>>.