数组的reduce方法学习回顾

160 阅读1分钟



test() {

  this.total = this.arr.reduce((total, currentValue) => {

    return total + currentValue;
    });
}