-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Open
Labels
Description
I have two arrays with objects:
const arr1 = [{ id: 1, paramA: 'value1' }, { id: 2, paramA: 'value2' }];
const arr2 = [{ id: 2, paramB: 'value11' }, { id: 3, paramB: 'value22' }];Want something like that:
const res = combine(arr1, arr2, 'id');And expect intersection of two arrays:
res = [{ id: 2, paramA: 'value2', paramB: 'value11' }];Same questions:
https://stackoverflow.com/questions/38612972/how-to-merge-two-arrays-of-objects-by-id-using-lodash
https://stackoverflow.com/questions/38505448/how-to-merge-multiple-array-of-object-by-id-in-javascript
I miss this method in lodash. I would find it very useful.