JS : .reduce() Method
const newNumbers = ;const newSum = newNumbers.reduce((accumulator, currentValue) => {
console.log('The value of accumulator: ', accumulator);
console.log('The value of currentValue: ', currentValue);
return accumulator + currentValue;
}, 10);
console.log(newSum);這是 .reduce() 方法。
頁:
[1]