Jayce
Jayce
```ts // solution 1 type IsUnion = [T] extends [never] ? false : T extends B ? [B] extends [T] ? false : true : never // solution 2 type...
```ts // 你的答案 type AnyOf = T[number] extends '' | false | 0 | [] | {[key: string]: never} | undefined | null ? false : true; ```
使用工具类型 Uncapitalize: Uncapitalize // 将 字符串 T 的第一个元素变成小写 ```ts type KebabCase = T extends `${infer A}${infer B}`? B extends Uncapitalize? `${Uncapitalize}${KebabCase}` : `${Uncapitalize}-${KebabCase}` :T ```
```ts type Merge = { [k in keyof (F & S)]: k extends keyof S ? S[k] : k extends keyof F ? F[k] : never } ```
```vue import { ref, watch,watchEffect } from "vue" const count = ref(0) /** * Challenge 1: Watch once * Make sure the watch callback only triggers once */ watch(count, ()...
```ts // your answers type OmitByType = { [k in keyof T as T[k] extends U ? never : k]: T[k] } ```
```ts // 你的答案 solution 1:面向结果编程 type FbArr = [1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144]; type Fibonacci = FbArr[T]; solution 2:利用数组长度实现加法 type Fibonacci =...