How to Loop Through a JavaScript Object
<p>I used </p>

<blockquote>
  <p>console.log(response);</p>
</blockquote>

<p>and got the following in console (in Firebug). How do I loop through to check if "LMNOPQ" exists?</p>

<pre><code>data        [Object { name="Excel in ABCD", category="Book", id="327361517327399", more...}, Object { name="LMNOPQ", category="Product/service", id="175625882542984", more...}, Object { name="UVWXYZ", category="Book", id="260641707360118", more...}, 7 more...]
            0       Object { name="Excel in ABCD", category="Book", id="327361517327399", more...}
            category        "Book"
            created_time        "2012-04-04T05:31:04+0000"
            id      "327361517327399"
            name        "Excel in ABCD"
            1       Object { name="LMNOPQ", category="Product/service", id="175625882542984", more...}
            2       
Object { name="UVWXYZ", category="Book", id="260641707360118", more...}
</code></pre>

<p>Then as suggested by Baptiste Pernet, I tried the following:</p>

<pre><code>for(var i in response) {
    console.log(response[i].name);//gives me undefined
    console.log(response[i]);//gives me another object (it is nested, check below)
}
</code></pre>

<blockquote>
  <p>[Object { name="Excel in ABCD", category="Book", id="327361517327399",
  more...},  Object { name="LMNOPQ", category="Product/service",
  id="175625882542984", more...},  Object { name="UVWXYZ",
  category="Book", id="260641707360118", more...},</p>
</blockquote>

<p>How do I get this name now? I'm stuck at:</p>

<pre><code>console.log(response[i]);
</code></pre>

<p>What should I write in order to get the properties of nested objects? Another loop?</p>
