- I don't want to change the original sequence of Objects in an array.
- But I need to get the items in sequence when the location and place are equal.
- I tried but I need for an and condition.
var sim=[{name:"vinod",location:"asia",place:"simha"},{name:"ajay",location:"zyd", place:"aaa"},{name:"ram",location:"raj",place:"zzz"},
{name:"abhirma",location:"zyd",place:"aaa"},
{name:"ram",location:"raj",place:"zzz"}];
sim.sort(function(a, b){
return a.location.localeCompare(b.location);
});
console.log(sim);