The only examples I have been able to find of people using $.each
are html samples, and it's not what I want. I have the following object:
var obj = {
obj1: 39,
obj2: 6,
obj3: 'text'
obj4: 'text'
obj5: 0
};
I loop through the object like so:
$(array).each(function(index, value) {
// ...
});
I want to sort by obj3
and obj4
. Preferrably not using an asynchronous method, how can I sort the results before (or during) output? (I also don't want to loop through this twice, as there could be hundreds at any given time.