一. Typrscript函数类型同时指定
同时指定: 表示同时定义类型别名 并 在函数内使用
type mytype = (num1:number , num2:number) => number
cosnt numFn: mytype = (num1 , num2) => {
return num1 + num2
}
二.Typrscript Void 类型
function numFn( name:string ): void {
console.log(name)
}
注意: 如果一个函数没有返回值 那么函数类型为 : void