Using array elements as input for IterTools.product()

Hi,

I want to take elements of an array of arrays like [ [list1] , [list2] , [list3] ] and feed them as input into IterTools.product(), so that I obtain IterTools.product( [list1] , [list2] , [list3] ) which can be executed. Any idea how I transfer the array elements as input into the function?

Thanks!

You can use splatting:

julia> arrays = [[1,2,3], [4,5]];

julia> Iterators.product(arrays...) |> collect
3×2 Matrix{Tuple{Int64, Int64}}:
 (1, 4)  (1, 5)
 (2, 4)  (2, 5)
 (3, 4)  (3, 5)