Live Preview
type Awaited<T> = T extends Promise<infer R> ? Awaited<R> : T;
// Your solution
// Test cases
type Case1 = MyAwaited<Promise<string>>; // string为什么选择 TypeScript 挑战?
我们的平台提供了一种独特的方式来学习 TypeScript类型系统,通过实践挑战掌握核心概念。
交互式学习
在浏览器中直接解决挑战,获得实时反馈和类型检查。
循序渐进
从简单挑战开始,逐步过渡到高级类型操作。
AI 驱动
获取 AI 生成的详细解释和解决方案分析,帮助理解复杂的类型系统概念。
挑战
探索类型挑战
从基础工具类型到复杂类型操作,为每个技能水平提供挑战。
Pick
Implement the built-in Pick<T, K> generic without using it.
Implement the built-in Pick<T, K> generic without using it.
utility-types
beginner
Readonly
Implement the built-in Readonly<T> generic without using it.
Implement the built-in Readonly<T> generic without using it.
utility-types
beginner
TupleToObject
Given an array, transform it into an object type.
Given an array, transform it into an object type.
tuple
transformation
准备好提升你的 TypeScript 技能了吗?
立即开始挑战,通过实践掌握 TypeScript 类型系统的强大功能。