93
rated 0 times
[
95]
[
2]
/ answers: 1 / hits: 61392
/ 8 Years ago, thu, august 4, 2016, 12:00:00
How can I sum the values in objects which share a common key? I need to use Lodash for this because I need good performance if these arrays get huge.
var prjMgrValues = [
{proj_mgr:Jack ProjManager,submitted_dollars:12000},
{proj_mgr:Jack ProjManager,submitted_dollars:750000},
{proj_mgr:Joe ProjManager,submitted_dollars:45000}
]
I'm looking for an output of
[
{proj_mgr:Jack ProjManager,submitted_dollars:762000},
{proj_mgr:Joe ProjManager,submitted_dollars:45000}
]
More From » lodash