title: Javascript "pop" from object
body: <p>I wrote the following code to "pop" a property from an object as if it were an array.  This looks like the kind of code that would get me slapped by more serious programmers, so I was wondering what is the proper way to do this:</p>
  
  <pre><code>// wrong way to pop:
  for( key in profiles ){
      var profile = profiles[key];  // get first property
      profiles[key] = 0;            // Save over property just in case "delete" actually deletes the property contents instead of just removing it from the object
      delete profiles[key];         // remove the property from the object
      break;                        // "break" because this is a loop
  }
  </code></pre>
  
  <p>I should have mentioned above, that unlike a true "pop", I don't need the objects to come out in any particular order.  I just need to get one out and remove it from its parent object.</p>