naming variables from loop jquery
<p>This is a follow question from <a href="https://stackoverflow.com/questions/34981100/jquery-loop-to-generate-variables">https://stackoverflow.com/questions/34981100/jquery-loop-to-generate-variables</a></p>

<p>So i'm trying to make variables in newly created arrays in my function. Then i will have to call each newly created variable to my chart.</p>

<pre><code>var digits = [2012, 01, 5, 88, 2012, 01, 6, 90, 2012, 05, 9, 130];
size = 3;
data = []

while (digits.length &gt; 0)
data.push(digits.splice(0, size));
var mysize = data.length;
for (i = 0; i &lt; data.length; i++) {
  x = 0
  console.log("This is set " + i)
  console.log('This is the data for array ' + i + '\n ' + data[i])
  for (j = 0; j &lt; 3; j++)
  console.log(data[i][j])
</code></pre>

<p>MY second console.log statement prints out arrays in sets of four. I need to name each of those arrays, and then i need to be able to call each individual array in my chart, which is in a separate function.</p>

<p>Right now each array is named from the line </p>

<pre><code>console.log('This is the data for array ' + i + '\n ' + data[i])
</code></pre>

<p>with no variable set from this line.</p>

<p>The end result should be 
    my1 = [2012,1,5,88]
    my2 = [2012, 1,6, 90]
    my3 = [2012, 5, 9, 130]
And since the data from my array could scale I wont be able to know how many new variable arrays i need to make. That's why the code should auto generate new array variable names, and break the original data into sets of four.</p>

<p>Then i would have to pass each newly created variable separately into my chart.</p>