Create multidimensional array spanned by unknown number of arrays

I have an (unknown) number of arrays, stored in an array:

arrays = [[1,2,3],[1,2,3,4],[1,2,3,4,5]]     # In this case three

I want to create a multidimensional array, with one dimension for each array (so I don’t know the dimension). In each element of my new array, I want to have some element that is a function of the corresponding elements in the array:

function my_func(input)
    return sum(input)

In the case when I know the number of input arrays I can do this easily, e.g.

array_3d = [my_func([e1,e2,e3]) for e1 in arrays[1], e2 in arrays[2], e3 in arrays[3]]

but If I don’t know the number of arrays in my array, I don’t know how to do this.

Check for a possible solution in this post.

Thanks. The last reply, suggesting:

N = 4
s = 0
for i in Iterators.product(fill(1:4, N)...)
    s += sum(i)

does work to loop through the arrays, and to do some function on them. However, it does not tell me how to save the function evaluations to an array. I could predeclare the array, but then it wouldn’t work if I didn’t know the dimensions.