times
Returns the cartesian product of this and other.
By requiring both lists to actually be lists of lists, this method can be chained.
Consider the following examples, using a simplified notation for lists for readability:
$ [[1, 2]] * [[3, 4]]
[[1, 3], [1, 4], [2, 3], [2, 4]]
$ [[1, 2]] * [[3, 4]] * [[5, 6]]
[[1, 3, 5], [1, 3, 6], [1, 4, 5], [1, 4, 6], [2, 3, 5], [2, 3, 6], [2, 4, 5], [2, 4, 6]]
Content copied to clipboard