I have seen questions and answers how to sort array by one value (text or number) and by two numbers (years and count of something).
How can I sort by one string in Ascending order and another string in special order?
Here is one object from array
var stop = {
type: "S", // values can be S, C or H. Should ordered S, C and then H.
street: "SW Dummy St." // Should be sorted in ascending order
}
And expected end result should look like this
var data = [
{ type: 'S', year: 'SW Karp' },
{ type: 'S', year: 'SW Walker' },
{ type: 'C', year: 'SW Greth' },
{ type: 'C', year: 'SW Main' }
{ type: 'H', year: 'SW Dummy' }
];