title: Javascript: how to access anonymous object within object?
body: <p>I have a string generated by php's json_encode() that looks like this:</p>
  
  <pre><code>[ { "key1":"value1",
      "key2":"value2",
      "key3":"value3"
    },
    { "key1":"value1",
      "key2":"value2",
      "key3":"value3"
    } ]
  </code></pre>
  
  <p>I use Javascript function to convert the string to Javascript object:</p>
  
  <pre><code>var jsonObj=JSON.parse(string);
  </code></pre>
  
  <p>How do I access the data inside since the inner objects have no names? I tried something like:</p>
  
  <pre><code>alert(jsonObj.firstChild.key1);
  </code></pre>
  
  <p>It gives me "undefined". Why is that so?</p>