I have some data in an array. I want to groupby the data based on a specific column. Please note, its not sorting that I want.
Example:
Name Dept
AAA D1
BBB D2
CCC D1
DDD D2
EEE D1
FFF D2
I want to groupby the data based on dept. SO the output should be as below:
Name Dept
AAA D1
CCC D1
EEE D1
BBB D2
DDD D2
FFF D2
I want to implement this using jQuery\Javascript. This is to populate a grid with data, and there are around 8 columns, though I have just shown two columns in the above example. The idea here is to groupby a specific column, say Dept .
Please suggest.
Thanks in advance!!!