title: parse json object in javascript to get key and values
body: <p>I have a object, need to parse the below data</p>
  
  <pre><code>  var data= [{"obj1":"2122"},{"obj2":"123"}]
  </code></pre>
  
  <p>to get both the keys and values in javascript. I yried to use:</p>
  
  <pre><code>var obj = JSON.parse(data);
  for(var prop in data) {
  if(data.hasOwnProperty(prop))
    console.log(prop);
  }
  </code></pre>
  
  <p>The values that are obtained in console are</p>
  
  <pre><code>Object {obj1: "2122"}
  Object {obj2: "123"}
  </code></pre>
  
  <p>But I need to access the values seperately and not as object. How to retrieve it from that object?</p>