doc: update typescript.md (#440)

修正 范型推导出列表字面量内示例代码错误
This commit is contained in:
2023-09-23 18:10:09 +08:00 committed by GitHub
parent c9dcfd2829
commit c70a95e007
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1557,8 +1557,8 @@ const a = <T extends string>(t: T) => t;
const b = <T extends number>(t: T) => t;
const c = <T extends boolean>(t: T) => t;
const d = a("a"); // const d: 'a'
const e = a(1); // const d: 1
const f = a(true); // const d: true
const e = b(1); // const d: 1
const f = c(true); // const d: true
// 这里t的类型用了一个展开运算
const g =