Suppose to have an array of two or more objects as:
const arr =[{PM1:10, PM10:20},{PM1:20, PM10:30, CO:27}, {NO2:30}]
How can I efficiently compute average values for each property in the objects comprising the array? I don't know in advance the properties in each object and even if there are common properties. I would expect a result:
{PM1:15, PM10:25, CO:27, NO2:30}
I suppose that I can use reduce but I can't figure it out how.