Looking for a way to sequentially find different arrangement possibilities of an array. I only care about adding them sequentially, doesn\'t need skip or shuffle values.
You could iterate over each character once and should be able to populate all sequences.
Here is what you could do.
var inputArray = ['a', 'b', 'c', 'd', 'e', 'f'];
var outputStrings = [];
inputArray.forEach((item, idx) => {
let prevString = (idx !== 0) ? outputStrings[idx - 1] : "";
outputStrings.push(prevString + item);
});
console.log(outputStrings);