如何对共享公共键的对象中的值求和?我需要为此使用 Lodash,因为如果这些数组变得很大,我需要良好的性能。
var prjMgrValues = [
{"proj_mgr":"Jack ProjManager","submitted_dollars":12000},
{"proj_mgr":"Jack ProjManager","submitted_dollars":750000},
{"proj_mgr":"Joe ProjManager","submitted_dollars":45000}
]
我正在寻找输出
[
{"proj_mgr":"Jack ProjManager","submitted_dollars":762000},
{"proj_mgr":"Joe ProjManager","submitted_dollars":45000}
]