javascript 数组里的数字全部相加var array = [1,2,3,4,5,6]; var sum = array.reduce(function(a,b){ return parseInt(a) + parseInt(b); },0); console.log(sum)
確定! 回上一頁