title: Can I loop through a javascript object in reverse order?
body: <p>So I have a JavaScript object like this:</p>
  
  <pre><code>foo = {
    "one": "some",
    "two": "thing",
    "three": "else"
  };
  </code></pre>
  
  <p>I can loop this like:</p>
  
  <pre><code>for (var i in foo) {
    if (foo.hasOwnProperty(i)) {
      // do something
    }
  }
  </code></pre>
  
  <p>Which will loop through the properties in the order of <code>one</code> > <code>two</code> > <code>three</code>.</p>
  
  <p>However sometimes I need to go through in reverse order, so I would like to do the same loop, but <code>three</code> > <code>two</code> > <code>one</code>.</p>
  
  <p><strong>Question:</strong><br>
  Is there an "object-reverse" function. If it was an Array, I could reverse or build a new array with <code>unshift</code> but I'm lost with what to do with an object, when I need to reverse-loop it's properties. Any ideas?</p>
  
  <p>Thanks! </p>