ICode9

精准搜索请尝试: 精确搜索
  • [Typescript] 31. Medium - Length of String2022-09-14 15:31:21

    Compute the length of a string literal, which behaves like String#length. /* _____________ Your Code Here _____________ */ type LengthOfString<S extends string, ACC extends any[] = []> = S extends '' ? ACC['length']: S extends `

  • [Typescript Challenges] 28. Medium - Replace2022-09-12 16:34:54

    Implement Replace<S, From, To> which replace the string From with To once in the given string S For example type replaced = Replace<'types are fun!', 'fun', 'awesome'> // expected to be 'types are awesome!�

  • [Typescript] 23. Medium - Promise.all2022-09-09 15:03:19

    Type the function PromiseAll that accepts an array of PromiseLike objects, the returning value should be Promise<T> where T is the resolved result array. const promise1 = Promise.resolve(3); const promise2 = 42; const promise3 = new Promise<strin

  • [Typescript] 18. Medium - Deep Readonly2022-09-08 03:00:08

    Implement a generic DeepReadonly<T> which make every parameter of an object - and its sub-objects recursively - readonly. You can assume that we are only dealing with Objects in this challenge. Arrays, Functions, Classes and so on do not need to be

  • [Typescript] 13. Easy - Unshift2022-09-04 00:04:01

    Implement the type version of Array.unshift For example: type Result = Unshift<[1, 2], 0> // [0, 1, 2,]   /* _____________ Your Code Here _____________ */ type Unshift<T extends unknown[], U> = [ U, ...T ] /* _____________ Test Cases __

  • [Typescript] 14. Easy - Parameters2022-09-04 00:03:00

    Implement the built-in Parameters generic without using it. For example: const foo = (arg1: string, arg2: number): void => {} type FunctionParamsType = MyParameters<typeof foo> // [arg1: string, arg2: number]   /* _____________ Your Code Here __

  • [Typescript Challenges] 10. Medium - Include2022-09-02 20:31:09

    Implement the JavaScript Array.includes function in the type system. A type takes the two arguments. The output should be a boolean true or false. For example: type isPillarMen = Includes<['Kars', 'Esidisi', 'Wamuu', 

  • [Typescript Challenges] 4. Easy - First of Array2022-09-02 02:03:11

    Implement a generic First<T> that takes an Array T and returns it's first element's type. type arr1 = ['a', 'b', 'c'] type arr2 = [3, 2, 1] type head1 = First<arr1> // expected to be 'a' type

  • [Typescript Challenges] 5. Easy - Length of Tuple2022-09-02 02:02:04

    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', &

  • [Typescript Challenges] 6 Easy - Exclude2022-09-02 02:01:43

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

  • [Typescript Challenges] 7. Easy - Awaited2022-09-02 02:00:36

    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<E

  • 【渝粤教育】 国家开放大学2020年春季 1325妇产科学与儿科护理学 参考试题2021-12-21 19:03:13

    试卷代号:1332 2 0 2 0年春季学期期末统一考试 中文学科论文写作 试题(开卷) 2020年7月 一、填空题(每空1分,共10分) 1.从总体上说,_____________性、_____________性和_____________性,是学术论文所应具备的基本特征。 2.按其功用的不同,可将论文中的注释分为两大类:(1) _____________的

  • 国家开放大学2021春1132卫生管理题目2021-12-08 13:01:15

    教育 教育 试卷代号: 1132 2021年春季学期期末统一考试 卫生管理 试题 2021年7月 一、单选题(每题2分,共30分) 1.管理一方面具有同生产力、社会化生产产生联系的自然属性,另一方面又有同生产关系、社会制度相联系的属性,这体现了( )。 A.管理的协调性 B.管理的艺术性 C.管理的二重

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有