📜  js 默认参数 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:19.740000             🧑  作者: Mango

代码示例1
function multiply(a, b = 1) {
  return a * b;
}

console.log(multiply(5, 2));
// expected output: 10

console.log(multiply(5));
// expected output: 5