Advertisement
Guest User

Untitled

a guest
Apr 26th, 2015
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. function cartesianProductOf() {
  2. return _.reduce(arguments, function(a, b) {
  3. return _.flatten(_.map(a, function(x) {
  4. return _.map(b, function(y) {
  5. return x.concat([y]);
  6. });
  7. }), true);
  8. }, [ [] ]);
  9. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement