Combine Duplicates in array

I have an array where I have Ticket ID, Company Names and Time spent on a work order, however I need to be able to combine the Company1 Entries into one one object and add up the time by ticket id, or for any duplicated ticket id. so it looks like:
{"TimeArray":[{"arTicket":2562,"arName":"Company1","arTime":0.9666666666666667},{"arTicket":2564,"arName":"Company2","arTime":0.08333333333333333},{"arTicket":2562,"arName":"Company1","arTime":0.4166666666666667}"]

So far I haven’t been able to figure out how to use a while loop or repeat to go back through the results and create a new array with the arTime entries added together for a ticket Id.

This is generated from the following server side:

Community Page
Last updated: