"tasks" : {
"details" : [
{
"task" : "a",
"hours" : 5,
"_id" : ObjectId("6333fdc699f7cb3da66be656")
},
{
"task" : "2",
"hours" : 5,
"_id" : ObjectId("6335ed42115208d81dffd082")
},
{
"task" : "b",
"hours" : 6,
"_id" : ObjectId("6335ed7d115208d81dffd118")
}
]
}
I am trying to get the totals of "hours" with reduce function but I cannot make it right. Someone can help with this since I'm new to javascript?