Skip to content
Advertisement

How to convert array of objects into custom grouped array

I am trying to convert the data object to custom format

This is my data which i want to convert

JavaScript

This is what i want to acheive

JavaScript

This is what i have tried till now

JavaScript

even i tried to refer this Javascript group objects by property

any suggestions would be helpful.

Advertisement

Answer

Assuming an array of objects as result set, you could take a hash table with arrays and take a flat array as result set.

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