title: Arrays in Google Scripts
body: <p>I am struggling with arrays in google scripts.
  Let's say I have range: "A1:B4". 
  <br />
  |Column A|column B|
  <br />
  |name1 |value1|
  <br />
  |name1 |value2|
  <br />
  |name2 |value3|
  <br />
  |name2 |value4|</p>
  
  <pre><code> var ss = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Arkusz1");
   var range = ss.getRange("A1:B4").getValues();
   var array = [[]];
  </code></pre>
  
  <p>So, I have to do an array that would look like this:</p>
  
  <pre><code> array[0] = name1
   array[0][0] = value1
   array[0][1] = value2
   array[1] = name2
   array[1][0] = value3
   array[1][1] = value4
  </code></pre>
  
  <p>I made this</p>
  
  <pre><code> for(var i = 0; i &lt; range.length; i++)
   {
      array[i] = range [i][0];
      for(var j = 0; j &lt; range[i].length; j++)
      {
        array[i][j] = range[i][j];  
      }   
   }
  </code></pre>
  
  <p>And I am getting on the second dimension I am getting first chars from the first dimension and I cannot change the value after it, e.g. Instead of <strong>value1</strong> on:</p>
  
  <pre><code>array[0][0]
  </code></pre>
  
  <p>I have <strong>n</strong> only (the first letter from name1)</p>
  
  <p>I will appreciate any idea.</p>
  
  <p>@EDIT<br>
  <img src="https://i.stack.imgur.com/vljub.png" alt="enter image description here"></p>
  
  <p>Ok, thank You all for answers but it is not it (or I am too stupid to understand). I have this table, what I need to do is make one array where <strong>car1</strong> is <code>array[0]</code>, <strong>car2</strong> is <code>array[1]</code> etc and every value in B is unique date ( <code>array[0][0]</code> -> one date for <strong>car1</strong>, <code>array[0][1]</code> different day but still for <strong>car1</strong> and then, in the third dimension summed up all values from column C but with depends on same date. I hope it is clear enough.</p>