title: Printing Backbone.js collection through console.log(), what's wrong with this?
body: <p>OK. I'm starting out on Backbone.js, and trying to do some very simple things. Here's a very simple Model and Collection.</p>
  
  <pre><code>// my model
  Friend = Backbone.Model.extend({});
  
  // my collection
  Friends = Backbone.Collection.extend({});
  
  // instantiate friends and add some friends objects!
  var friends = new Friends();
  friends.add([
    {name: "James"},
    {name: "Michael"}
  ]);
  
  console.log(friends.length) // prints out 2! which is correct!
  </code></pre>
  
  <p>Above example is fine. But now I want to initialize my collection from server, which returns the exact same JSON object.</p>
  
  <pre><code>// my model
  Friend = Backbone.Model.extend({});
  
  // my collection
  Friends = Backbone.Collection.extend({
    url: 'http://localhost/myapp/get_users'
  });
  
  // instantiate friends and add some friends objects!
  var friends = new Friends();
  friends.fetch();
  
  console.log(friends.length) // prints out 0! WHY???
  </code></pre>
  
  <p>I've been looking at my Chrome inspection panel for both of them and regardless, I have no idea why one from the server is not working?</p>
  
  <p>FYI, on the server side, I have CodeIgniter 2.02, using Phil Stuegeon's REST API to return a JSON data.</p>
  
  <p>I've also tried a simple function on my PHP side, like</p>
  
  <pre><code>function get_users() {
    echo '{name:"James"}, {name:"Michael"}';
  }
  </code></pre>
  
  <p>But without any success.</p>
  
  <p>What am I doing wrong here?</p>