Javascript Sort Array By Two Properties