跳到主內容

【ES6】其他新語法

預設值

function sum(a, b = 1) { // 加入預設值避免錯誤
  return a + b;
}
console.log(sum(1));