Categories
Mastering Development

Add matching values from one array to an array of original object

I have a users list like the following: [ { user: a, email: a.com, events: [] }, { user: b, email: b.com events: [] } ] And an events list: [ { user: a, start: 2020-01-01 end: 2020-01-02 }, { user: a, start: 2020-02-01 end: 2020-02-02 }, { user: b, start: 2020-03-01 end: 2020-03-02 }, […]