Skip to content

List Product

The list::product function computes the Cartesian product of two or more lists, resulting in all possible combinations of their elements.

Syntax

list::product(<list1>, <list2>, ...)

Parameters

  • list1, list2, ...: Two or more lists whose Cartesian product will be calculated.

Returns

  • List of Lists: A list where each element is a combination of one element from each input list.

Example

Try it out below!
list::product([1, 2], ["A", "B"])

This function is useful for generating combinations or permutations of elements for testing or data processing.