应该一次循环就能搞定吧
let MondayTotal = 0;
MondayTotal = newData.reduce((item, v) => {
return item + parseFloat(v.Monday);
}, MondayTotal);
let TuesdayTotal = 0;
TuesdayTotal = newData.reduce((item, v) => {
return item + parseFloat(v.Tuesday);
}, TuesdayTotal);
let WednesdayTotal = 0;
WednesdayTotal = newData.reduce((item, v) => {
return item + parseFloat(v.Wednesday);
}, WednesdayTotal);
let ThursdayTotal = 0;
ThursdayTotal = newData.reduce((item, v) => {
return item + parseFloat(v.Thursday);
}, ThursdayTotal);
let FridayTotal = 0;
FridayTotal = newData.reduce((item, v) => {
return item + parseFloat(v.Friday);
}, FridayTotal);
let SaturdayTotal = 0;
SaturdayTotal = newData.reduce((item, v) => {
return item + parseFloat(v.Saturday);
}, SaturdayTotal);
let SundayTotal = 0;
SundayTotal = newData.reduce((item, v) => {
return item + parseFloat(v.Sunday);
}, SundayTotal);
四季花海
海绵宝宝撒
相关分类