I have the following array:
[
[1],
[2, 22],
[3, 33, 333],
[4]
]
I want to turn it into the following array:
[
[1, 2, 3, 4],
[1, 2, 33, 4],
[1, 2, 333, 4],
[1, 22, 3, 4],
[1, 22, 33, 4],
[1, 22, 333, 4],
]
The order of the numbers in each sub-array matters, but the order of the sub-arrays within the big one doesn't. 1 must always come before 2, and so on. I'm using numbers to simplify but they will be strings, so I can't use math for this.
Edit: A simple version of the above would be the following:
// the following:
[
[1],
[2, 22],
]
// would be converted to:
[
[1, 2],
[1, 22]
]