例如现在有一个数组
{
"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}]
}
定义 sumCHO / sumProtein / sumDF
如何将数组内 cho / protein / df 根据数组的长度进行相加并赋值呢
胡子哥哥
相关分类