📜  typescript 默认参数 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:18.311000             🧑  作者: Mango

代码示例1
function sayName({ first, last = 'Smith' }: {first: string; last?: string }): void {
  const name = first + ' ' + last;
  console.log(name);
}

sayName({ first: 'Bob' });