title: Uncaught TypeError: Cannot read property 'length' of undefined for simple JSON array
body: <p>I am calling a function this way .</p>
  
  <pre><code>var responseinner = returnvalues(selectedeleemnt);
  
  console.log(responseinner);      
  </code></pre>
  
  <p><strong>displaying as Object</strong></p>
  
  <pre><code>console.log(JSON.stringify(responseinner)); 
  </code></pre>
  
  <p><strong>displaying as</strong> <code>[{"name":"Coke","image":"json_images/coke_can.jpg","type":["250ml","300ml"],"price":["50","60"]}]</code> </p>
  
  <p>I tried all the ways of parsing this value </p>
  
  <pre><code>[{"name":"Coke","image":"json_images/coke_can.jpg","type":["250ml","300ml"],"price":["50","60"]}] 
  </code></pre>
  
  <p>But always it throws the error as</p>
  
  <p><strong>Uncaught TypeError: Cannot read property 'length' of undefined</strong></p>
  
  <p>I used JSON.parse , JSON.stringfy() . but none helped .</p>
  
  <pre><code>for (var i = 0; i &lt; responseinner.type.length; i++) {
  
  }
  </code></pre>
  
  <p>could anybody please help me </p>