Skip to content

Instantly share code, notes, and snippets.

View ChrisJefferson's full-sized avatar

Christopher Jefferson ChrisJefferson

View GitHub Profile
function cartesianProductOf() {
return _.reduce(arguments, function(a, b) {
return _.flatten(_.map(a, function(x) {
return _.map(b, function(y) {
return x.concat([y]);
});
}));
}, [ [] ]);
};