📜  javascript代码示例中2个变量的总和

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

代码示例2
function sumArray(a, b) {
      var c = [];
      for (var i = 0; i < Math.max(a.length, b.length); i++) {
        c.push((a[i] || 0) + (b[i] || 0));
      }
      return c;
}