Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript cartesian product

const cartesian =
  (...a) => a.reduce((a, b) => a.flatMap(d => b.map(e => [d, e].flat())));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #cartesian #product
ADD COMMENT
Topic
Name
9+9 =