赞
踩
//函数默认值
const fun = (num1: number = 12, num2: number = 24): number => {
return num1 + num2
}
fun()
//函数默认值
const fun = (num1: number = 12, num2?: number ): number => {
return num1 + num2 ? num2 : 0
}
fun()
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。