title: JS working with two array
body: <p>I need to create an array <code>cells</code> as described in my comment.
  I would like to know what is wrong with this script, and the more perfomant way to achieve this result. </p>
  
  <p>Look at the js fiddle <a href="http://jsfiddle.net/XvTrf/5/" rel="nofollow">http://jsfiddle.net/XvTrf/5/</a></p>
  
  <pre><code>var data = ['D-0','D-1','D-2','D-3','D-4','D-5','D-6','D-7','D-8','D-9'];
  
  var cells=[];
  var d = 0, lenD = data.length;
  
  while(d&lt; lenD){
      if(d === 1 || d === 5 || d ===6){
         cells.push('test');
      }else {
          cells.push(data[d]);
      }
      d++;
  }
  console.log(cells);
  
  
  /* result wanted
  D-0
  test
  D-1
  D-2
  D-3
  test
  test
  D-4
  D-5
  D-6
  D-7
  D-8
  D-9
  
  */
  </code></pre>