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 (
homes.sort(function(a,b) { return a.city - b.city } ); homes.sort(function(a,b){ if (a.city==b.city){ return parseFloat(b.price) - parseFloat(a.price); } else { return 0; } });