Orderby data in an array

Orderby data in an array

Hi All,

I have a grid. I want to orderby(sort) data based on two columns.

EmpID EmpName Dept Date Of Joining
1 ABC D1 1/1/2011
2 DEF D2 1/1/2011
3 GHI D3 2/1/2012
4 JKL D1 9/1/2012
5 MNO D2 6/1/2014

I want to sort this data in two ways. First it should be sorted by "Date Of Joining" - DESC and then grouped by "DEPT".

All employees of same dept should be grouped and displayed with Date of Joining as highest.

I have the entire data in an array. I want to achieve this using jQuery.

Please suggest 

Thanks in advance.