title: Creating an multidimensional array of array objects
body: <p>I have a multidimensional array created by  taking data from a google spreadsheet. I am attempting to seperate out the data based on results in a specific column. For example:</p>
  
  <pre><code>    var j = {
        ["Mine", "House"],
        ["Your", "House"],
        ["his", "apt"]
      }
  </code></pre>
  
  <p>Given that we want to seperate by column 2. We should get in theory:</p>
  
  <pre><code>var new = {
            [["Mine", "House"] , ["Your", "House"]],
            [["his", "apt"]]
          }
  </code></pre>
  
  <p>Two entries being a house, and 1 being an apartment. I am haveing a huge issue with treating each entry as its own obj. Assuming it is even possible. I guess we would access specific parts of each object like so, <code>new[0][1][1]</code>? <strong>This obviously shouldnt work like this</strong>. Is there another way to seperate the entries in the way I am attempting? As it stands right now, I believe my code is just creating the same number of rows as in the original data. </p>
  
  <pre><code> var spreadsheet = SpreadsheetApp.getActive();
        spreadsheet.insertSheet("Report");
  
        var data_sheet =spreadsheet.getSheetByName("Data");
        var genCounsel_data = data_sheet.getRange(240, 1, 96, 7).getValues(); //get genCounseling data
        var report_sheet = spreadsheet.getSheetByName("Report");
  
        //setup key values for columns in report sheet
        report_sheet.appendRow(["Student Service", "Unit Student Service Outcome", "Indicators Data Sources", "How indicator was measured", "Benchmark Data", "Assigned to do Assessment", "Email"])
  
        //seperate out by SS outcomes
        var genCounselDataByOutcomes = new Array(new Array()); //all responses for each outcome, also parrellel
        var outcomes_freq = new Array(); //parrellel arrays
        var found = false;
  
        //get services and frequency;
        for(var i=0; i&lt;genCounsel_data.length; ++i){
          genCounsel_data[i][OUTCOMES_COL].toString().toLowerCase();
          for(var j=0; j&lt;genCounselDataByOutcomes.length &amp;&amp; !found; ++j){
            if(genCounselDataByOutcomes[j][OUTCOMES_COL] == genCounsel_data[i][OUTCOMES_COL]){
              genCounselDataByOutcomes[j].push(genCounsel_data[i]); //ADD to row with same outcomes
              ++outcomes_freq[j]; //update amount of entries in said outcome
              found = true;
            }
          }
          if(found == false){
            genCounselDataByOutcomes.push(new Array);
            genCounselDataByOutcomes[genCounselDataByOutcomes.length-1].push([genCounsel_data[i]]);
            outcomes_freq.push(1);
          }
          else
            found = false;
        }
  
        for(var i=0; i&lt;outcomes_freq.length;++i)
          Logger.log(outcomes_freq[i]);
  
        //for each outcome select a random one and move entire row to sheet;
        for(var i=0; i&lt;genCounselDataByOutcomes.length; ++i){
          Logger.log(genCounselDataByOutcomes[i]);
        }
  </code></pre>
  
  <p><strong>QUESTION:</strong></p>
  
  <p>How can I seperate my data as multiple objects in a row of an array and be able to access specific components of each entry as shown in my example above? If this is not exactly possible in this way, is there another solution to this issue?</p>