Explaining my problem may be a bit tricky due to my limited proficiency in English. I am currently working on an app using Angular.js, so our discussion will revolve around Javascript.
Imagine we have 2 arrays structured like this:
[
[
"Item 1",
"Item 2"
],
[
"Item A",
"Item B",
"Item C"
]
]
My goal is to generate something along these lines:
[
"Item 1 Item A",
"Item 1 Item B",
"Item 1 Item C",
"Item 2 Item A",
"Item 2 Item B",
"Item 2 Item C"
]
The challenge arises when there are multiple arrays (3, 4, 5...) and the number of items in each array varies. The ultimate objective is to concatenate every item with all the others only once. Does anyone have any suggestions?
I have experimented with angular.forEach, for loops, among other techniques, but I am yet to discover a workable solution...