首页
AI Coding
沸点
课程
直播
活动
APP
插件
搜索历史
清空
创作者中心
写文章
发沸点
写笔记
写代码
草稿箱
创作灵感
查看更多
登录
注册
TypeScript类型体操
灯下白头人
创建于2023-11-29
订阅专栏
记录type-challenges挑战过程,深入理解Ts
等 1 人订阅
共8篇文章
创建于2023-11-29
订阅专栏
默认顺序
默认顺序
最早发布
最新发布
Typescript类型体操的总结
Typescript类型体操的总结和一些思考,可能有偏差或者有误解,后续会继续完善和总结,方便以后查阅。
00268-easy-if
Implement `If<C, T, F>` which accepts condition `C`, a truthy value `T`, a falsy value `F`.
00043-easy-exclude
Implement the built-in Exclude<T, U>,Exclude from `T` those types that are assignable to `U`
00018-easy-length-of-tuple
For given a tuple, you need create a generic Length, pick the length of the tuple
00014-easy-first-of-array
Implement a generic First<T> that takes an Array T and returns its first element's type.
00011-easy-tuple-to-object
Given an array, transform it into an object type and the key/value must be in the provided array.
00007-easy-readonly
Implement the built-in Readonly<T> generic without using it
00004-easy-pick
Implement the built-in Pick<T, K> generic without using it.