dailyTask=[ { subject: 'Documentation', owner_id: 1 }, { subject: 'SERVICES', owner_id: 2 } ];
emails=[ { employee_id: 1, email_id: '[email protected]' }, { employee_id: 2, email_id: '[email protected]' } ];
merge two arrays on keys owner_id and employee_id and the required result is shown below
output=[ {employee_id:1,owner_id:1,email_id:'[email protected]',subject:'Documentation'}, {employee_id:2,owner_id:2,email_id:'[email protected]',subject:'SERVICES'} ];