title: Stringify array inside an object
body: <p>Can someone explain why JSON.stringify output is different from item1 and item2 objects.</p>
  
  <pre><code>var item1 = {
      name: '',
      childItems: [],
      addChild: function (name) {
          var child = Object.create(item1);
          child.name = name;
          this.childItems.push(child);
      }
  };
  
  var item2 = {
      name: '',
      addChild: function (name) {
          var child = Object.create(item2);
          child.name = name;
          if (this.childItems === undefined){
              this.childItems = [];
          }
          this.childItems.push(child);
      }
  };
  </code></pre>
  
  <p>Stringifying objects</p>
  
  <pre><code>var root = Object.create(item1);
  root.name = 'root';
  root.addChild('child');
  console.log(JSON.stringify(root)); //{"name":"root"}
  
  root = Object.create(item2);
  root.name = 'root';
  root.addChild('child');
  console.log(JSON.stringify(root)); //{"name":"root","childItems":[{"name":"child"}]}
  </code></pre>
  
  <p>The latter is the result I am looking for, but I can not figure out why the item1 not working?</p>