Hey there, I have an array of objects that need to be sorted (either DESC or ASC) by a specific property in each object.
Below is 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];
I am looking to sort the data array so that the objects are arranged by date. Can anyone assist with this?