title: Sorting a JavaScript object by property name
body: <p>I've been looking for a while and want a way to sort a Javascript object like this:</p>
  
  <pre><code>{
      method: 'artist.getInfo',
      artist: 'Green Day',
      format: 'json',
      api_key: 'fa3af76b9396d0091c9c41ebe3c63716'
  }
  </code></pre>
  
  <p>and sort is alphabetically by name to get:</p>
  
  <pre><code>{
      api_key: 'fa3af76b9396d0091c9c41ebe3c63716',
      artist: 'Green Day',
      format: 'json',
      method: 'artist.getInfo'
  }
  </code></pre>
  
  <p>I can't find any code that will do this. Can anyone give me some help?</p>