上一页 1 ··· 116 117 118 119 120 121 122 123 124 ··· 494 下一页
摘要: // This is an input class. Do not edit. class Node { constructor(value) { this.value = value; this.prev = null; this.next = null; } } // Feel free to 阅读全文
posted @ 2022-08-04 01:17 Zhentiw 阅读(32) 评论(0) 推荐(0)
摘要: The definite assignment !: operator is used to suppress TypeScript’s objections about a class field being used, when it can’t be proven1 that it was i 阅读全文
posted @ 2022-08-03 20:11 Zhentiw 阅读(27) 评论(0) 推荐(0)
摘要: Requirements: function strBuilder(str) { return strBuilder; // TODO } var hello = strBuilder("Hello, "); var kyle = hello("Kyle"); var susan = hello(" 阅读全文
posted @ 2022-08-03 19:56 Zhentiw 阅读(30) 评论(0) 推荐(0)
摘要: value is Foo The first kind of user-defined type guard we will review is an is type guard. It is perfectly suited for our example above because it’s m 阅读全文
posted @ 2022-08-03 13:23 Zhentiw 阅读(65) 评论(0) 推荐(0)
摘要: class UnreachableError extends Error { constructor(_nvr: never, message: string) { super(message) } } class Car { drive() { console.log("vroom") } } c 阅读全文
posted @ 2022-08-03 01:59 Zhentiw 阅读(17) 评论(0) 推荐(0)
摘要: For the following class: class Car { make: string model: string year: number constructor(make: string, model: string, year: number) { this.make = make 阅读全文
posted @ 2022-08-01 17:17 Zhentiw 阅读(45) 评论(0) 推荐(0)
摘要: function f(...args) { return args; } function flip(fn) { return function flipped (arg1, arg2, ...args) { return fn(arg2, arg1, ...args) } } let z = fl 阅读全文
posted @ 2022-07-31 16:45 Zhentiw 阅读(34) 评论(0) 推荐(0)
摘要: Construct signatures are similar to call signatures, except they describe what should happen with the new keyword. interface DateConstructor { new (va 阅读全文
posted @ 2022-07-28 15:46 Zhentiw 阅读(92) 评论(0) 推荐(0)
摘要: Recursive types, are self-referential, and are often used to describe infinitely nestable types. For example, consider infinitely nestable arrays of n 阅读全文
posted @ 2022-07-27 19:15 Zhentiw 阅读(45) 评论(0) 推荐(0)
摘要: An interface is a way of defining an object type. An “object type” can be thought of as, “an instance of a class could conceivably look like this”. Fo 阅读全文
posted @ 2022-07-27 19:14 Zhentiw 阅读(45) 评论(0) 推荐(0)
上一页 1 ··· 116 117 118 119 120 121 122 123 124 ··· 494 下一页