UNPKG

@stdlib/array

Version:
26 lines (18 loc) 426 B
{{alias}}( x ) Returns the Cartesian square. If provided an empty array, the function returns an empty array. Parameters ---------- x: ArrayLikeObject Input array. Returns ------- out: Array<Array> Cartesian product. Examples -------- > var x = [ 1, 2 ]; > var out = {{alias}}( x ) [ [ 1, 1 ], [ 1, 2 ], [ 2, 1 ], [ 2, 2 ] ] See Also --------