having trouble wrapping my head around how to code something up, I've done a bit of googling but haven't found anything that does this specific task. I've had some ideas but none of them seem practical, and I'm afraid I'd miss some combinations.
Imagine you have an array of 6 people
var people = ['bob', 'joe', 'jeff', 'sandy', 'jessica', 'april'];
And an array of 6 shirts
var shirts = ['red', 'blue', 'green', 'yellow', 'purple', 'white'];
How can we generate a list of every possible combination of these 6 people wearing these 6 shirts? Something like:
[ ['bob', 'red'], ['joe', 'blue'], ['jeff', 'green'], ['sandy','yellow'], ['jessica', 'purple'], ['april', 'white'] ]
[ ['bob', 'blue'], ['joe', 'red'], ['jeff', 'green'], ['sandy','yellow'], ['jessica', 'purple'], ['april', 'white'] ]
...
..
.
Any help or links would be greatly appreciated!