title: Iterating through multiple arrays in Javascript without using indices
body: <p>I'm trying to loop over multiple arrays using a single "for in" or "for each" loop.</p>
  
  <p>I have three arrays namely, <strong>name</strong>, <strong>id</strong> <strong>, and</strong> <strong>available</strong>. The size of these arrays are equal. </p>
  
  <p>What I need to do is that I need to iterate through each value of the above arrays and based on the index of the row and column (values of i and j, respectively), copy the value of the element to a cell in spreadsheet.</p>
  
  <p>The below is the code I am using:</p>
  
  <pre><code>for (i = 1; i &lt;= copy_range.getNumRows(); i++) {
    for (j = 1; j &lt;= copy_range.getNumColumns(); j++) {
      if (j == 1) {
        var name_cell = copy_range.getCell(i, j);
        // I want to do this however I'm not able to do this since I already have i and j for
        // row and column iteration and that another nested loop makes things complicated
        name_cell.setValue(name[k]);
      }
      else if (j == 2) {
        var id_cell = copy_range.getCell(i, j);
        Logger.log(id_cell.getA1Notation());
        id_cell.setValue(id[k]); //Same idea as in previous if
      }
      else {
        var availability_cell = copy_range.getCell(i, j);
        Logger.log(availability_cell.getA1Notation());
        availability_cell.setValue(available[k]); //Same as if and else if loops previously.
      }
    }   
  </code></pre>
  
  <p>The reason I'm not able to use indices is that I already use <code>i</code> and <code>j</code> as iterative variables to refer to row and column, and using another nested loop does not give me the intended output - it leads to unwanted iterations and execution time.</p>
  
  <p>Please let me know if there is any way where I can use a "for in" or a similar loop to iterate over each item of all the three arrays.</p>