Can I loop through a javascript object in reverse order?
问题 So I have a JavaScript object like this: foo = { "one": "some", "two": "thing", "three": "else" }; I can loop this like: for (var i in foo) { if (foo.hasOwnProperty(i)) { // do something } } Which will loop through the properties in the order of one > two > three . However sometimes I need to go through in reverse order, so I would like to do the same loop, but three > two > one . Question: Is there an "object-reverse" function. If it was an Array, I could reverse or build a new array with