忽略检查
// @ts-ignore 单行忽略
// @ts-nocheck 忽略全文
函数
//书写完整函数类型 let myAdd: (x: number, y: number) => number = function(x: number, y: number): number { return x + y; }; //可选参数 function buildName(firstName: string, lastName?: string) {} //剩余参数 function buildName(firstName: string, ...restOfName: string[]) { return firstName + " " + restOfName.join(" "); }