Cartesian product of two or more lists: Difference between revisions

m
(→‎Functional JS: Updated applicative version)
Line 1,092:
For the Cartesian product of just two lists:
<lang JavaScript>(() => {
// CARTESIAN PRODUCT OF TWO LISTS -----------------------------------------
 
// cartProd :: [a] -> [b] -> [[a, b]]
Line 1,099:
 
 
// TEST -------------------------------------------------------------------
return [
cartProd([1, 2])([3, 4]),
9,655

edits