If I had a collection like this:
var array = {
"fruit": ["apple","banana"],
"amount": ["1", "2", "3"],
"orign": ["africa", "asia", "europe"],
...
"n": ["0", "...", "n"]
}
How would I get all combinations in a JSON format like this:
[
{
"fruit": "apple",
"amount": "1",
"orign": "africa"
}
{
"fruit": "apple",
"amount": "1",
"orign": "asia"
}
...
]
Is it possible to loop through all elements in a iterative manner? Or would I end up writing n loops?