How can I find the cartesian product of multiple arrays using JavaScript?
Take this for example
cartesian([1, 2], [10, 20], [100, 200, 300])
this should return something like this
[
[1, 10, 100],
[1, 10, 200],
[1, 10, 300],
[2, 10, 100],
[2, 10, 200]
...
]