Skip to content
Advertisement

Split array with equal indices

I have a result array which is formatted like the following:

JavaScript

I want to split and organize this array like the following example if it is possible:

JavaScript

I wish I could divide by 2 or more if there are more companies and then show the states and the amount of a priori stores.

Advertisement

Answer

I feel the array structure is like php, so here is php solution.

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement