First, to solve this problem I had a look to stackoverflow… The examples are very confusing, pretty hard to read. They use loops iterations and I don’t like it anymore. They use external dependencies, and I think it is not required.
Sure, it’s not the big deal of the century to resolve this issue. Although recursive algorithms can reverse your brain for a while when you don’t practice.
So I’ve decided to create it with no loops, only pure recursive functions, no dependencies except a test framework.
I invite you to have a look at the code on Github. Of course, Ideas to improve it are welcome :) and I hope this share will help you
Here the main page of the repository
Contribute to array-cartesian-product development by creating an account on GitHub.github.com
And the npm repo