title: Continuing the count of an array of iterations
body: <p>In Javascript, I am running a simple for loop that increments where <code>num</code> can be any given input number:</p>
  <pre><code>const sequenceArr = [];
  
    for (let i = 0; i &lt;= num; i++) {
      const addedSum = i + i;
  
      sequenceArr.push({ i, addedSum });
    }
  </code></pre>
  <p>You could imagine that when <code>num</code> is some given number, say 1000, an array of objects up to 1000 is generated and the object simply looks something like this: <code>[{1, 2}, {2, 4}, {3, 6} ... {1000, 2000} ]</code>. Now say you want to go to 2000. The for loop is ran all over again, reiterating and counting over the same numbers starting from 0, executing the same operations on the same numbers and it just doesn't seem very optimal. How could I basically continue the count, continuing from 1001 or whatever my last number in <code>sequenceArr</code> is? Instead of starting all the way back over from 0 and count up to our new <code>num</code>, 2000? Should I push to a backend and import the json file? How could I implement that?</p>
  <p>This is for a small side project where I count up to a given number so I can run the <code>addedSum</code> operation on <code>i</code>. I later map over and look into the sequence and run a series of checks. I just noticed the sequenceArr never changes, therefore I shouldn't keep regenerating the same numbers, and use existing numbers if  <code>num</code> is less than our array length, and only make and push new ones if my sequenceArr is &lt; than <code>num</code>.</p>
  <p>I would also need to then push/update the new numbers that continued the count, to my sequenceArr to update the sequence.</p>