[Solved] How can I sum object values by array data using ES standard? [closed]

A reduce and forEach to group by tag and then taking the values for each tag var a= [ { “cost”: 500, “revenue”: 800, “tag”: [ “new”, “equipment”, “wholesale” ] }, { “cost”: 300, “revenue”: 600, “tag”: [ “old”, “equipment” ] }, { “cost”: 800, “revenue”: 850, “tag”: [ “wholesale” ] } ] let x … Read more