Open RainZhai opened 5 years ago
cartesian() { return Array.prototype.reduce.call(arguments, function (a, b) { var ret = []; a.forEach(function (a) { b.forEach(function (b) { ret.push(a.concat([b])); }); }); return ret; }, [[]]); }