主页
TypeScript
TypeScript 函数
demo_functions_params_optional
运行 ❯
×
更改方向
保存代码
更改主题
// the `?` operator here marks parameter `c` as optional function add(a: number, b: number, c?: number) { return a + b + (c || 0); } console.log(add(2,5))
7