Combining JSON Arrays with jQuery
===

I've spent all morning messing with this now and reading on here, but have found myself going round in circles!

I am trying to draw a chart using the excellent `AmCharts` Javascript Charts, to show me stock holding as a bar chart and stock turn as a line chart.

I cannot get both sets of data from one query to my database, and cannot use AmCharts StockChart as it is not time based data... therefore, I have two sets of data which need combining with Javascript.

The data is being pulled from a database and returned successfully as JSON arrays similar to this:

**SALES DATA:**
    
    [{"brandName":"Fender","gearShiftedPerMonth":"35","retailSalesPerMonth":"55"},
     {"brandName":"Gibson","gearShiftedPerMonth":"23","retailSalesPerMonth":"43"},
     {"brandName":"Epiphone","gearShiftedPerMonth":"10","retailSalesPerMonth":"13"}]

**STOCK DATA:**

    [{"brandName":"Gibson","stockValue":"1234"},
     {"brandName":"Fender","stockValue":"975"},
     {"brandName":"Epiphone","stockValue":"834"}]

Obviously the actual figures are made up in that example!

Now, what I need to do is to combine those to create this:

**COMBINED DATA**

    [{"brandName":"Fender","gearShiftedPerMonth":"35","retailSalesPerMonth":"55","stockValue":"975"},
     {"brandName":"Gibson","gearShiftedPerMonth":"23","retailSalesPerMonth":"43","stockValue":"1234"},
     {"brandName":"Epiphone","gearShiftedPerMonth":"10","retailSalesPerMonth":"13","stockValue":"834"}]

What we have there is the Sales Dataset combined with Stock Dataset to add the additional data of `stockValue` added to the corresponding brandName record.

I have tried using `$.extend` but I can't figure out how to use it in this situation.

It is perhaps important to note that the data pairs might not necessarily be in the right order, and it is possible, though unlikely, that there might not be a match, so some kind of zeroing error catching must be implemented.
