title: Getting first JSON property
body: <p>Is there a way to get the name of the first property of a JSON object?</p>
  <p>I'd like to do something like this:</p>
  <pre><code>var firstProp = jsonObj[0];
  </code></pre>
  <p><strong>edit:</strong> I'm getting a JSON object which hold categories of arrays with image
  URLs.</p>
  <p>like so:</p>
  <pre><code>{
    &quot;category1&quot;:[&quot;image/url/1.jpg&quot;,&quot;image/url/2.jpg&quot;],
    &quot;category2&quot;:[&quot;image/url/3.jpg&quot;,&quot;image/url/4.jpg&quot;]
  }
  </code></pre>
  <p>I am then iterating through the object to insert the images, and all I really wanted was an elegant way to see which category was inserted first. At first I just did</p>
  <pre><code>for (var cat in images) {
      if (i==0) firstCat = cat;
      ...
  }
  </code></pre>
  <p>But that some how &quot;felt&quot; ugly... So it was basically just a question of elegance.</p>