Can anybody please help me generate a new array from an existing array. Here's my array (sample)
[
1,
2,
[3,4],
9
[5,6],
[7,8]
]
And here's what i want to achieve
[
[1,2,3,9,5,7],
[1,2,4,9,5,7],
[1,2,3,9,6,7],
[1,2,4,9,6,7],
[1,2,3,9,5,8],
[1,2,4,9,5,8],
[1,2,3,9,6,8],
[1,2,4,9,6,8]
]
Thanks
Edit Because I want to make a proper combination of the nested array. I dont think this question will help.