- #1

- 141

- 11

Code:

```
// Returns all subarrays of the given array, not including the empty array
// ex. [a,b,c].subarrays() = [ [a], [b], [c], [a,b], [a,c], [b,c], [a,b,c] ]
Array.prototype.subarrays = function(...)
{
// ..
}
```

in a larger program I'm writing. (I know how to do it easily if the subarrays are contiguous sequences of the original array)

Also, if this makes things easier, in the single use case of my program the original array has unique items.