上一页 1 ··· 109 110 111 112 113 114 115 116 117 ··· 496 下一页
摘要: Chainable options are commonly used in Javascript. But when we switch to TypeScript, can you properly type it? In this challenge, you need to type an 阅读全文
posted @ 2022-09-08 14:34 Zhentiw 阅读(93) 评论(0) 推荐(0)
摘要: Implement a generic TupleToUnion<T> which covers the values of a tuple to its values union. For example type Arr = ['1', '2', '3'] type Test = TupleTo 阅读全文
posted @ 2022-09-08 13:44 Zhentiw 阅读(55) 评论(0) 推荐(0)
摘要: Implement a generic DeepReadonly<T> which make every parameter of an object - and its sub-objects recursively - readonly. You can assume that we are o 阅读全文
posted @ 2022-09-08 02:44 Zhentiw 阅读(70) 评论(0) 推荐(0)
摘要: Implement a generic MyReadonly2<T, K> which takes two type argument T and K. K specify the set of properties of T that should set to Readonly. When K  阅读全文
posted @ 2022-09-08 02:28 Zhentiw 阅读(46) 评论(0) 推荐(0)
摘要: Stack is dedicated to function Local variables are store in stack Deallocated after function completes Heap is persisten Carbage Collections Go is a c 阅读全文
posted @ 2022-09-07 16:17 Zhentiw 阅读(28) 评论(0) 推荐(0)
摘要: New is alernate way to create a variable new() function create a variable and returns a pointer to the variable Variable is initialized to zero packag 阅读全文
posted @ 2022-09-07 15:06 Zhentiw 阅读(24) 评论(0) 推荐(0)
摘要: Write a MinMaxStack class for a Min Max Stack. The class should support: Pushing and popping values on and off the stack. Peeking at the value at the 阅读全文
posted @ 2022-09-07 14:26 Zhentiw 阅读(47) 评论(0) 推荐(0)
摘要: Implement the built-in Omit<T, K> generic without using it. Constructs a type by picking all properties from T and then removing K For example interfa 阅读全文
posted @ 2022-09-06 15:03 Zhentiw 阅读(48) 评论(0) 推荐(0)
摘要: Implement the built-in ReturnType<T> generic without using it. For example const fn = (v: boolean) => { if (v) return 1 else return 2 } type a = MyRet 阅读全文
posted @ 2022-09-06 14:41 Zhentiw 阅读(38) 评论(0) 推荐(0)
摘要: // User type User struct { ID int FirstName string } // Method func (u *User) describe() string { desc := fmt.Sprintf("Name %s", u.FirstName) return d 阅读全文
posted @ 2022-09-06 02:31 Zhentiw 阅读(26) 评论(0) 推荐(0)
上一页 1 ··· 109 110 111 112 113 114 115 116 117 ··· 496 下一页