Beginner Vue ask how to sum the objects in the array?

for example, there is now an array
{

"msg": "success",
"code": 0,
"list": [{
    "mealId": 17,
    "mealName": "",
    "protein": 1,
    "typeList": null,
    "df": 1,
    "cho": 1
}, {
    "mealId": 18,
    "mealName": "",
    "protein": 1,
    "typeList": null,
    "df": 1,
    "cho": 1
}]

}

define sumCHO / sumProtein / sumDF
how to add and assign cho / protein / df in an array according to the length of the array

Aug.21,2021

let choTotal = list.reduce((totle, item) => total + item.cho)
let proteinTotal = list.reduce((totle, item) => total + item.protein)
let dfTotal = list.reduce((totle, item) => total + item.df)

basic positive solution on the first floor

Menu