title: Javascript change for loop variable from within the loop
body: <p>I have a for loop like so</p>
  
  <pre><code>for (var i = 0; i &lt; 100; i += 4) {
      // code with i;
  }
  </code></pre>
  
  <p>I would like to change the value of <code>i</code> to a certain value from within the loop. I am aware you could use <code>continue</code> to change the value of <code>i</code> after evaluating the final-expression, but what if I wanted to change the value of i to something more specific like 40?</p>
  
  <p>Here's one of my attempts</p>
  
  <pre><code>loop:
  for (var i = 0; i &lt; 100; i += 4) {
      for (var i = 0; i &lt;= 40; i++) {
          continue loop;
      }
  }
  </code></pre>
  
  <p>Is there a better way of doing this?</p>