Dealing with two arrays here. One comes from an API and the other is fetched from Firebase. Both contain a common key, which is the TLD as illustrated below.
API Array
[
{
"TLD" : "com",
"tld_type": 1,
},
"TLD" : "org",
"tld_type" : 1,
}
]
Firebase Array
[
{
"TLD" : "com",
"register_price" : 14.99
},
{
"TLD" : "org",
"register_price" : 15.99
}
]
The goal is to merge these arrays into one cohesive array like this:
[
{
"TLD" : "com",
"tld_type" : 1,
"register_price" : 14.99
},
{
"TLD" : "org",
"tld_type" : 1,
"register_price" : 15.99
}
]
I've tried using concact
after some online research but it doesn't seem to consider the key while matching elements. Any thoughts on how to achieve this?