There are three arrays with repeating _id keys, you need to merge them or merge them into one, while there are no duplicates with the _id .
var arr1 = [ { '_id': '1', 'man': 20 }, { '_id': '2', 'man': 15 } ] var arr2 = [ { '_id': '1', 'woman': 13 }, { '_id': '2', 'woman': 18 } ] var arr3 = [ { '_id': '1', 'animal': 2 }, { '_id': '2', 'animal': 8 } ] It is necessary that the result would be
[ { '_id': '1', 'woman': 13 'man': 20 'animal': 2 }, { '_id': '2', 'woman': 18 'man': 15 'animal': 8 } ] How to make the union of arrays effectively in one cycle? Or maybe there is a special lodash method?