EDIT: it appears as though I was incorrect when I first posted, newly defined Javascript specs state that (to my utter surprise) javascript objects do indeed have ordering (Sort JavaScript object by key)! This being said, I still would not recommend attempting to order elements of an object itself, but rather to go with the key-sorting approach that I have described below. Object.keys(obj) as well as a few other edge cases appear to still have no guarantee of ordering and I would argue that that is good enough reason to stay away from depending on the order of the keys of your objects.
Original post below.
Unless I understand javascript incorrectly, the keys in a javascript object have no guaranteed ordering. This means that, in theory, I could create the object
{'a':'hi', 'c':'hey', 'b':'hello'}
And, on iterating through its keys I could get any possible ordering of 'a', 'b', and 'c'.
If you need to display your objects in any particular order, I would suggest accessing the keys of your object and sorting those and then accessing your object in the sorted order of your newly sorted keys.
(Can be seen implemented here: Is there a way to sort/order keys in JavaScript objects?)