title: How to write a for loop that will pick up a count where it left off?
body: <p>I know this is very silly question, but I am struggling to find this logic. I am trying to work on this very basic for loop to achieve this result</p>
  
  <pre><code>0 - 0
  0 - 1
  0 - 2
  0 - 3
  0 - 4
  0 - 5
  0 - 6
  0 - 7
  0 - 8
  0 - 9
  0 - 10
  0 - 11
  
  1 - 12
  1 - 13
  1 - 14
  1 - 15
  1 - 16
  1 - 17
  1 - 18
  1 - 19
  1 - 20
  1 - 21
  1 - 22
  1 - 23
  
  2 - 24
  2 - 25
  2 - 26
  2 - 27
  2 - 28
  2 - 29
  2 - 30
  2 - 31
  2 - 32
  2 - 33
  2 - 34
  2 - 35
  </code></pre>
  
  <p>The inner loop should continue from the number where the first inner loop was cut done.
  in the first iteration it left off at <code>11</code>, the second time it comes to the inner loop it should go from <code>12 - 24</code> and so forth.</p>
  
  <pre><code>var count = 0;
  var val = 0;
  for(i = 0; i &lt; 3; i++) {
      for(j = 0; j &lt; count + 12; j++) {
          console.log(i + " - " + j);       
  
      }
      val = j;
      count = count + j;
      console.log(count);
  }
  </code></pre>