title: How to partition array into multiple groups using Lodash?
body: <p>I'm trying to find a concise way to partition an array of objects into groups of arrays based on a predicate.  </p>
  
  <pre><code>var arr = [
    {id: 1, val: 'a'}, 
    {id: 1, val: 'b'}, 
    {id: 2, val: 'c'}, 
    {id: 3, val: 'a'}
  ];
  
  //transform to below
  
  var partitionedById = [
    [{id: 1, val: 'a'}, {id: 1, val:'b'}], 
    [{id: 2, val: 'c'}], 
    [{id: 3, val: 'a'}
  ];
  </code></pre>
  
  <p>I see <a href="https://stackoverflow.com/questions/29538967/how-to-split-array-into-n-groups-factorize-or-partition-array">this question</a> , which gives a good overview using plain JS, but I'm wondering if there's a more concise way to do this using lodash?  I see the <a href="https://lodash.com/docs#partition" rel="noreferrer">partition function</a> but it only splits the arrays into 2 groups (need it to be 'n' number of partitions).  The <a href="https://lodash.com/docs#groupBy" rel="noreferrer">groupBy</a> groups it into an object by keys, I'm looking for the same but in an array (without keys).  </p>
  
  <p>Is there a simpler way to maybe nest a couple lodash functions to achieve this?  </p>