Hay, i have an array of objects and i need to sort them (either DESC or ASC) by a certain property of each object.
Here's the data
obj1 = new Object;
obj1.date = 1307010000;
obj2 = new Object;
obj2.date = 1306923600;
obj3 = new Object;
obj3.date = 1298974800;
obj4 = new Object;
obj4.date = 1306923600;
obj5 = new Object;
obj5.date = 1307096400;
data = [obj1,obj2,obj3,obj4,obj5];
Now, i want to order the data array so that the objects are in order by date.
Can someone help me with this?