How to print the id
<p>Here is the code. This code gets the friends list from facebook. It comes as <code>name</code> and <code>id</code> pair for every friend. I get this using <code>response["data"]</code> and store it in <code>friends</code>.
when I print <code>friends</code>, I get what is added below:</p>

<p><strong>First:</strong></p>

<pre><code>if(loggedIn) {
    FB.api("/me/friends",function(response){
        friends = response["data"];
        totalToBeLoaded = friends.length;
      document.getElementById("status").innerHTML=friends;

  });
</code></pre>

<p>The output is:</p>

<blockquote>
  <p>[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],[object Object],[object
  Object],</p>
</blockquote>

<p><strong>Second:</strong>
If I change the above code this way:</p>

<pre><code>if(loggedIn) {
  FB.api("/me/friends",function(response){
      friends = response["data"];
      totalToBeLoaded = friends.length;
    document.getElementById("status").innerHTML=friends[0].id;
  });
</code></pre>

<p>it prints . id at 0 position correctly as</p>

<p>Output:</p>

<blockquote>
  <p>1243533622(id)</p>
</blockquote>

<p><strong>Third:</strong>
 Since there are more ids if I put it in a <code>while-loop</code> and print everything:</p>

<pre><code>if(loggedIn) {
  FB.api("/me/friends",function(response){
    friends = response["data"];
    totalToBeLoaded = friends.length;
    while(i&lt;totalToBeLoaded)
      document.getElementById("status").innerHTML=friends[i].id;
  });
</code></pre>

<p>Output :</p>

<blockquote>
  <p></p>
</blockquote>

<p>Nothing is printed.</p>

<p>How do I print all the <code>id</code>'s?</p>
