Generates the cartesian product of multiple arrays.
The arrays to combine
An array of combinations (each combination is an array)
cartesian([1, 2], ['a', 'b']); // [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']] Copy
cartesian([1, 2], ['a', 'b']); // [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
Generates the cartesian product of multiple arrays.