cartesianProduct (Functional Programming) es-toolkit
Creates a function that computes the Cartesian product with the piped array. Use it with pipe.
Info
Prefer the original es-toolkit cartesianProduct in ordinary code. Use this fp variant when composing transformations with pipe.
Usage
cartesianProduct returns every possible tuple formed by taking one value from the piped array and one value from each configured array. The rightmost array advances fastest.
Parameters
arrsArray<readonly T[]>required
The arrays to include after the piped array.
Returns
A function that maps the piped array to the Cartesian-product tuples.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.