How can I combine two arrays into a single array that contains more complex data structures with matching values on both sides?
var arr1 = [{
"id": "4",
"ip_address": "127.0.0.1",
"username": "superuser",
"password": "$2y$08$awherOdjNPRoDHAiNBGZNuA92UGfT7jsIpsMMcNnyyJMxBA8Ug9q6",
"salt": null,
"email": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1764626772655776737a7e793974787a">[email protected]</a>",
"activation_code": null,
"forgotten_password_code": "NULL",
"forgotten_password_time": null,
"remember_code": "cBjcajHj8qXaNrOhkAAqPe",
"created_on": "2018-09-13",
"last_login": "1540549332",
"active": "1",
"first_name": "Super",
"last_name": "Admin",
"phone": "0",
"user_id": "4",
"groups": [{
"id": "10",
"name": "superusers",
"description": "Super Administrators",
"$$hashKey": "object:38"
}],
"$$hashKey": "object:11"
}];
var arr2 = [{
"id": "1",
"ip_address": "127.0.0.1",
"username": "administrator",
"password": "$2y$08$DoULTzDyGFyh.DTNOvxRtujA3CT2yVBMpp6joYnfUcD0FQgbm9rmy",
"salt": "",
"email": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d0b1b4bdb9be90b1b4bdb9befeb3bfbd">[email protected]</a>",
"activation_code": "",
"forgotten_password_code": null,
"forgotten_password_time": null,
"remember_code": "wYiqzg7AM2QbEPdVrqUhkO",
"created_on": "2010-03-18",
"last_login": "1537468397",
"active": "1",
"first_name": "Admin",
"last_name": "istrator",
"phone": "0",
"user_id": "1",
"groups": [{
"id": "3",
"name": "admins",
"description": "Administrators",
"$$hashKey": "object:32"
}],
"$$hashKey": "object:8"
}];