I have the following "data"
that is inside an object array and I have to find the average of each value of the "data"
this is the object I'm working with
var MARKDATA = {
"SOR": {
"mark": [
{
"data": {
"2015": 21.680000,
"2016": "",
"2017": 23.760000
},
"markName": "swimming",
"markCode": "SWM"
},
{
"data": {
"2015": "",
"2016": 61.55429840,
"2017": 61.482299804
},
"markName": "running (time)",
"markCode": "RM"
}
]
}
};
I want to create a new array with the average of the data values using reduce or any method that helps me with this. thanks