01 2024 档案
摘要://1、函数重载 function hello(name:string):string function hello(age:number):string function hello(value : string | number): string { if (typeof value 'stri
阅读全文
摘要://1、类型推断 不建议使用 let str = 'abc' str = '123' //console.log(str) //2、类型注释 let str1:string = "abc" str1 = 'ewer' //console.log(str1) //3、类型断言 let str2:str
阅读全文