网站首页 站内搜索

搜索结果

查询Tags标签: _____________,共有 4条记录
  • [Typescript Challenges] 7. Easy - Awaited

    If we have a type which is wrapped type like Promise. How we can get a type which is inside the wrapped type? For example: if we have Promise<ExampleType> how to get ExampleType? type ExampleType = Promise<string>type Result = MyAwaited&…

    2022/9/2 6:23:00 人评论 次浏览
  • [Typescript Challenges] 6 Easy - Exclude

    Implement the built-in Exclude<T, U> For example:type Result = MyExclude<a | b | c, a> // b | c/* _____________ Your Code Here _____________ */type MyExclude<T, U> = T extends U ? never: T/* _____________ Test Cases _____________ */…

    2022/9/2 6:22:58 人评论 次浏览
  • [Typescript Challenges] 5. Easy - Length of Tuple

    For given a tuple, you need create a generic Length, pick the length of the tuple For example: type tesla = [tesla, model 3, model X, model Y] type spaceX = [FALCON 9, FALCON HEAVY, DRAGON, STARSHIP, HUMAN SPACEFLIGHT]type teslaLength = Length<tesl…

    2022/9/2 6:22:58 人评论 次浏览
  • [Typescript Challenges] 4. Easy - First of Array

    Implement a generic First<T> that takes an Array T and returns its first elements type. type arr1 = [a, b, c] type arr2 = [3, 2, 1]type head1 = First<arr1> // expected to be a type head2 = First<arr2> // expected to be 3/* __________…

    2022/9/2 6:22:56 人评论 次浏览
扫一扫关注最新编程教程