jashkenas/underscore — pull request #1788 by krawaller (2014-08-14 12:16:37+00:00)
Title: Adding _.combine method that create all possible combinations from given arrays

This pull request implements a feature I've been missing; it returns all possible combinations of elements from the given arrays. Here's an example:
```
_.combine([1,2,3],["a","b"],[”foo","bar","baz"]);
// => [ [1,"a","foo"],[1,"a","bar"],[1,"a","baz"],[1,"b","foo"],[1,"b","bar"],[1,"b","baz"],[2,"a","foo"],[2,"a","bar"],[2,"a","baz"],[2,"b","foo"],[2,"b","bar"],[2,"b","baz"]]
```
Somewhat related to `zip` but not quite the same.

I was surprised to find no previous discussions on this here or on Underscore-contrib - perhaps it's less useful than I thought? I've used it somewhat often, and as the code to perform it is rather messy, I thought it might be a good fit for inclusion.