I'm trying to write a string permutation function, and I want to include all combinations of the letters ranging from 1 to n in size. I got this to work, but it includes duplicates:
function permutate(permutation, addendum) {
if (addendum.length == 0) {
console.log(permutation);
return;
}...