So I have 2 json arrays as string in the below variables. They both have the header "invoices" and I would like to merge the two together so there is only 1 header and 4 items inside.
currently have:
var info1 = {"invoices":[{"url":"https://api.freeagent.com/v2/invoices/1","contact":"https://api.freeagent.com/v2/contacts/1"},{"url":"https://api.freeagent.com/v2/invoices/2","contact":"https://api.freeagent.com/v2/contacts/2"}]}
var info2 = {"invoices":[{"url":"https://api.freeagent.com/v2/invoices/3","contact":"https://api.freeagent.com/v2/contacts/3"},{"url":"https://api.freeagent.com/v2/invoices/4","contact":"https://api.freeagent.com/v2/contacts/4"}]}
Desired outcome:
var info3 = {"invoices":[{"url":"https://api.freeagent.com/v2/invoices/1","contact":"https://api.freeagent.com/v2/contacts/1"},{"url":"https://api.freeagent.com/v2/invoices/2","contact":"https://api.freeagent.com/v2/contacts/2"},{"url":"https://api.freeagent.com/v2/invoices/3","contact":"https://api.freeagent.com/v2/contacts/3"},{"url":"https://api.freeagent.com/v2/invoices/4","contact":"https://api.freeagent.com/v2/contacts/4"}]}
Is there any functions that I can use to do this?