I have an array arrays
which contains a number of arrays (arbitrary). How do I iterate through all combinations of elelements? If I know that there are e.g. 3 arrays I can do:
for e1 in arrays[1], e2 in arrays[2], e3 in arrays[3]
do_stuff([e1,e2,e3])
end
but if the number is arbitrary, what do I do then?