I need some help on how to loop through this array of variable array sizes.
var x = [[1,2,3],[8],[10,11,12],[13]];
What I want the result to be in an array with the combinations.
y = [[1,8,10,13],[2,8,10,13],[3,8,10,13]
,[1,8,11,13],[2,8,11,13],[3,8,11,13]....]
I hope this makes sense what I want to do.
for(var i=0; i<x.length; i++)
{
for(var ii=0; x[i].length; ii++)
{
//At this point I have x[0], but each number needs to be part of a compination
}
}
What I ultimately want to do is take set of lists (amount of lists set by the user) and make a combination across the lists. Example 4 lists below.
1 5 8 12
2 6 11
3 9
4 10