I have an array with some chars in it:
var ar1 = ["a", "1"];
I want to create arrays with all permutations of this array, BUT which would have had given amount of slots like so:
if amount of slots is 3 the arrays would look like this:
["a", "1", "a"]
["1", "a", "1"]
["a", "a", "a"]
["1", "1", "1"]
["a", "a", "1"]
["1", "1", "a"]
["a", "1", "1"]
["1", "a", "a"]
and so on...
how can I make this happen?