商航

Results 40 comments of 商航

```js type Filter = T extends [infer A, ...infer B] ? Filter : R type F0 = Filter; // [6, 7] type F1 = Filter; // ["kakuqo", "lolo"] type F2...

```js function f(a: string, b: string) : string function f(a: number, b: number) : number function f(a: any, b: any) { if (typeof a === 'string') { return a +...

```js type IndexOf = A extends [infer S, ...infer B] ? Item extends S ? R['length'] : IndexOf : -1 type Arr = [1, 2, 3, 4, 5] type I0...

```js type StartsWith = T extends `${U}${string}` ? true : false type S0 = StartsWith // true type S1 = StartsWith // false type S2 = StartsWith // false type...

如果固定双层数组的话,用这个试试 ```js type NaiveFlat = T[number][number] ``` 多层实现方法,适用任意层级,同样可以替换上面的NaiveFlat ```js type DeepFlat = T extends any[] ? DeepFlat : T ``` ts@ 4.2.3

> ["Q","W"][number] {0:"Q",1:"W",}[number]这种格式为什么会自动循环展开取值啊,学TS的时候好像没看到这种写法啊 ```js ["Q","W"][0] // Q ["Q","W"][1 | 2] // Q | W // 1 | 2 extends number ["Q","W"][number] // Q | W ```

```js var a = [11, 42, 23, 4, 5, 6, 4, 5, 6, 11, 23, 42, 56, 78, 90] var res = [{sum: 0, arr: []}, {sum: 0, arr: []},...

具体错误信息是什么呢,使用http 也应该是没问题的

+1,用ip访问是正常的,用域名访问就不行了;而且我发现我把 input 标签去掉,一样能上传,应该没有用 children 中的 input