Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript cartesian product

let f = (a, b) => [].concat(...a.map(a => b.map(b => [].concat(a, b))));
let cartesian = (a, b, ...c) => b ? cartesian(f(a, b), ...c) : a;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #cartesian #product
ADD COMMENT
Topic
Name
3+6 =