//数组求和
this.tableData2 = [100,200,13,5,45,767,88.43,0], total = this.tableData2.reduce((prev, curr) => { const value = Number(curr); if (!isNaN(value)) { return prev + curr; } else { return prev; } }, 0);
//数组求和
this.tableData2 = [100,200,13,5,45,767,88.43,0], total = this.tableData2.reduce((prev, curr) => { const value = Number(curr); if (!isNaN(value)) { return prev + curr; } else { return prev; } }, 0);
相关课程