if (tl;dr) {
goto https://jsfiddle.net/y5v0ur4p/60/
Any ideas on how to run this permutation-pattern faster?
} else {
I was wondering if it was possible to write a non-recursive permutation function in javascript that could keep up with the performance of recursive ones (e.g. Heap's algorithm). After a couple of weeks I had an idea which worked out pretty well so far. Here's the explanation https://jsfiddle.net/u68wyvzk/6/
In case the explanation left something unclear, just ask :)
}