I'm looking for a good way to make a program for this problem:
First an array with string values is given:
var array1 = ["a", "b", "c", "d"]
Next I would like to store every possible combination(order) of the string values in new arrays
ex:
combo1 = ["a", "b", "d", "c"]
combo2 = ["a", "c", "b", "d"]
combo3 = [...etc.]
The program needs to be able to do this with big array's as well. With for example up to 20 items in the first array (array1). So it needs to do all the work of creating the 'combo array's' automatically with a function.
What would be a good way to tackle this problem? Preferably with JavaScript, but I'm open to hear about it in out languages.
As you may have guessed, I am a fairly beginner when it comes to programming. I have got the basics down and am now trying to wright a program for a project. Please help and thank you in advance!