title: Javascript: Getting a Single Property Name
body: <p>Given an object like this:</p>
  
  <pre><code>{ name: "joe" }
  </code></pre>
  
  <p>I want to get the value "name". I know I can use the for construct to iterate over the properties in an object, but the objects I'll be dealing with will always have a single key:value pair, and I won't know the name of the property. To further illustrate:</p>
  
  <pre><code>var a = { age: 24 };
  console.log(myFunc(a)) // Displays "age"
  
  var b = { job: "cook" };
  console.log(myFunc(b)) // Displays "job"
  </code></pre>
  
  <p>Is there anyway to do this without iterating over the object? Also I'd like to do this in pure Javascript. No frameworks/libs involved.</p>