📜  js for 循环加号 - Javascript 代码示例

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

代码示例1
var nums = ['100','300','400','60','40'],
    sum = nums.reduce(function(accum, val) {return accum + Number(val);}, 0);
alert(sum);