title: JSON - access the field of a field
body: <p>Let's say I have:</p>
  
  <pre><code> A = {
  
         B: {
            key : "value1"
         },
  
         C: {
            key : "value2"
         }
         ..............
  }
  </code></pre>
  
  <p>How can I get the values of the keys using a loop?</p>
  
  <p>I tried something like:</p>
  
  <pre><code>for(ob in A)
  {
      console.log(ob);
      console.log(ob.key);
  }
  </code></pre>
  
  <p>but I get:</p>
  
  <pre><code>B
  undefined
  C
  undefined
  </code></pre>