title: Backbone.js Empty Array Attribute
body: <p>I'm running into an odd issue with a Backbone.js Model where an array member is being shown as blank. It looks something like this:</p>
  
  <pre><code>var Session = Backbone.Model.extend({
      defaults: {
          // ...
          widgets: []
      },
      addWidget: function (widget) {
          var widgets = this.get("widgets");
  
          widgets.push(widget);
          this.trigger("change:widgets", this, widgets);
      },
      // ...
      // I have a method on the model to grabbing a member of the array
      getWidget: function (id) {
          console.log(this.attributes);
          console.log(this.attributes.widgets);
  
          // ...
      }
  });
  </code></pre>
  
  <p>I then add a widget via <code>addWidget</code>. When trying <code>getWidget</code> the result I get (in Chrome) is this:</p>
  
  <pre><code>Object
      widgets: Array[1]
          0: child
          length: 1
          __proto__: Array[0]
      __proto__: Object
  []
  </code></pre>
  
  <p>It's showing that widgets is not empty when logging <code>this.attributes</code> but it's shown as empty when logging <code>this.attributes.widgets</code>. Does anyone know what would cause this?</p>
  
  <p><strong>EDIT</strong>
  I've changed the model to instantiate the widgets array in the initialization method to avoid references across multiple instances, and I started using <a href="http://afeld.github.com/backbone-nested/" rel="nofollow noreferrer">backbone-nested</a> with no luck.</p>