A want to create a function that takes an array of arrays as arguments. I then want it to find all the combinations using 1 value from each array. I want the array to be able to be any length. The order of the arrays would not matter, although I want the first element of an array to correspond to the first array. For example:
function combine(arr){
return /* I need help with this part */;
}
var list = [['c',4,'b'],[1,'a']];
var foo = combine(list); //should equal bar
var bar = [['c',1],['c','a'],[4,1],[4,'a'],['b',1],['b','a']; //this should be the result of combine(list)
Also, could this be done with just for-loops, or would it have to be recursive?