Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function cartesianProductOf() {
- return _.reduce(arguments, function(a, b) {
- return _.flatten(_.map(a, function(x) {
- return _.map(b, function(y) {
- return x.concat([y]);
- });
- }), true);
- }, [ [] ]);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement