jQuery/Javascript Multiple Array Combinations
<p>I have been trying to find a solution to this with no avail. The idea of what i'm trying to achieve is to be able to find all unique combinations of multiple lists. So, let's say I have 3 lists of checkboxes (but this is an unknown number in the real-life application), Colour, Size, Pack Size. The items in the list's will be unqiue.</p>

<pre><code>[0] =&gt; ['blue', 'green']
[1] =&gt; ['small', 'medium', 'large']
[2] =&gt; ['Pack Of 6', 'Pack Of 8']
</code></pre>

<p>I will want to get "<strong>Blue, Small, Pack Of 6</strong>", "<strong>Blue, Medium, Pack Of 6</strong>", "<strong>Blue, Large, Pack Of 6</strong>", "<strong>Blue, Small, Pack Of 8</strong>", "<strong>Blue, Medium, Pack Of 8</strong>" etc..
The ordering isn't important, but would be nice to have it logically grouped. </p>

<p>I already have the lists pulled out into an array using jQuery:</p>

<pre><code>       options = [];

       jQuery('.option-types').each(function(){
            opts = [];
            jQuery('input:checked', this).each(function(){
                opts.push(jQuery(this).next().text());
            });
            options.push(opts)
        });
</code></pre>

<p>If there is a recursive functional path to answer this that would be ideal, as like i said the number of lists could be anything, aswell as the contents of the lists.</p>

<p>Hope you guys and girls can help, this is doing my head in.</p>

<p>Cheers - Dan</p>
