title: trying to add multiple similar objects to another object
body: <p>I'm trying to write a function that adds a new "row" that has an optional "cell" to an object. Here is my code:</p>
  
  <pre><code>   var init = function() {
      var num = 0;
      var count = 0;
  
      var SC = {}
  
      var rowAdd = function() {
          num = num + 1
          var cellstate = false;
  
          var objCount = count + 1
  
          var rowObj = {
              number: num,
              cell: cellstate
          }
  
          return SC.rowObj;
      }
  
      var initialize = function() {
          rowAdd();
      }
  initialize();
  }
  $(document).ready(function() {
      init();
  
      addRowBtn.click(function() {
          rowAdd();
      });
  
      addCellBtn.click(function() {
          SC.row1.cell = true;
      });
  });
  </code></pre>
  
  <p>This approach rewrites the row everytime i call <code>rowAdd()</code>. In the end I want a single object <code>SC</code> to contain every row, and each row should have a <code>cell</code> property. How can I do this?</p>