I have an object that looks like:
{
"2013": {
"name": 2013,
"ts_create": 1375254000000,
"view_url": "some_url",
"save_url": "some_url_2",
"id": "",
"exists": true,
"children": []
},
"2012": {
"name": 2013,
"ts_create": 1375254000000,
"view_url": "some_url",
"save_url": "some_url_2",
"id": "",
"exists": true,
"children": []
},
"2011": {
"name": 2013,
"ts_create": 1375254000000,
"view_url": "some_url",
"save_url": "some_url_2",
"id": "",
"exists": true,
"children": []
}
}
The problem I am facing is, it seems only in Google Chrome that when I loop over this object the objects loop backwards.
The expected result of looping over and displaying the object should list out things from 2013, 2012, 2011. Which happens in Firefox.. However no change in the method, same exact object in Chrome.. I will get 2011, 2012, 2013
So with this I need to obviously apply some level of sorting over this object before looping over it, seeing as Chrome wants to get the loop to read over it backwards. Problem I am facing with that is not entirely sure how to sort an object with JS