From this original question, how would I apply a sort on multiple fields?
Using this slightly adapted structure, how would I sort city (ascending) & then price (
I like SnowBurnt's approach but it needs a tweak to test for equivalence on city NOT a difference.
homes.sort( function(a,b){ if (a.city==b.city){ return (b.price-a.price); } else { return (a.city-b.city); } });