title: Getting the object's property name
body: <p>I was wondering if there was any way in JavaScript to loop through an object like so.</p>
  
  <pre><code>for(var i in myObject) {
      // ...
  }
  </code></pre>
  
  <p>But get the name of each property like this.</p>
  
  <pre><code>for(var i in myObject) {
      separateObj[myObject[i].name] = myObject[i];
  }
  </code></pre>
  
  <p>I can't seem to find anything like it on Google. They say to pass the names of the variables with them but this is not an option for what I am trying to achieve.</p>
  
  <p>Thanks for any help you can offer.</p>