title: Javascript get Object property Name
body: <p>I passed the following object:</p>
  
  <pre><code>var myVar = { typeA: { option1: "one", option2: "two" } }
  </code></pre>
  
  <p>I want to be able to pull out the key <code>typeA</code> from the above structure.</p>
  
  <p>This value can change each time so next time it could be <code>typeB</code>.</p>
  
  <p>So I would like to know if there is a way for me to do something like the following pseudo code:</p>
  
  <pre><code>var theTypeIs = myVar.key();
  </code></pre>
  
  <p>This way when I can pass this object and I can pull out the first value of the object, in this case it is <code>typeA</code> and then based on that I can do different things with <code>option1</code> and <code>option2</code>.</p>