dailyTask=[ { subject: 'Documentation', owner_id: 1 }, { subject: 'SERVICES', owner_id: 2 } ];
emails=[ { employee_id: 1, email_id: 'abcd@gmail.com' }, { employee_id: 2, email_id: 'abcdef@gmail.com' } ];
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:'abcd@gmail.com',subject:'Documentation'}, {employee_id:2,owner_id:2,email_id:'abcdef@gmail.com',subject:'SERVICES'} ];