TS --- 函數(定義,參數,重載) 筆記

一。函數的定義 二。參數(可選參數/默認參數/剩餘參數) //函數的參數 function add(x : number,y : number) : number{   return x + y } //可選參數? function show(name,age? : number) : void{   console.log(name,age) } show('zs')   //默認參數 注意:可
相關文章
相關標籤/搜索