This is a little difficult for me to describe in a single sentence/title. So, please forgive me if the title makes no sense at all.
To try and make it simpler and hopefully more clear, I'm going to number the arrays.
I wish to use array 1 to create multiple array 2s. I wish to put in the array 2s different values and lengths.
Then I wish to loop through array 2s to loop the values of said arrays
@Kinglish
What I currently have is the following:
let arrayOneCount = 3;
let arrayOne = [];
let arrayTwoCount = 1;
while (arrayTwoCount < arrayOneCount) {
arrayOne.push("arrayTwo" + (arrayTwoCount - 1));
arrayTwoCount++;
}
arrayTwo0 = [
"1",
"2",
"3"
];
arrayTwo1 = [
"1",
"2"
];
arrayTwo2 [
"1",
"2",
"3",
"4"
];
What I want to do with this is to loop through these arrays with a loop within that loop to loop the values of each respective array.
I have tried to do
arrayOne[0] = [
"1",
"2",
"3"
];
But that didn't work out.
Don't make "arrayTwo0" etc., make an array of arrays: let arrayTwo = [[1, 2, 3], [...], ...]. Then your syntax already works. – deceze
That fixed it. Thanks :)