I have an object in vuejs
data: {
food: {
monday: {
pizza:1,
chips:2,
pie:0,
},
tuesday: {
pizza:1,
chips:2,
pie:1,
}
}
}
I can access the value specifically with
this.food.monday.pizza
but how do I count the number of items eaten on monday (3 total)?