JS菜鸟在这里。如何设置一个变量等于所有三个动物对象的 currentDays 属性的总和?
var foods = {
chicken: {
'days': 1349.5,
'deaths': 28.63,
'currentDays': 1349.5,
'currentDeaths': 28.63
},
eggs: {
'days': 456.25,
'deaths': 1.733,
'currentDays': 456.25,
'currentDeaths': 1.733
},
pork: {
'days' :112.5,
'deaths': .445,
'currentDays': 112.5,
'currentDeaths': .445
},
};