I have an array of objects that all contain a property snail.
I'd like to mutate this array into an array of arrays, with each element array containing objects that have a common property snail
It is very similar to lodash _.partition, except it needs to happen an indeterminate number of times, recursively, and be on a flat level and not deeply nested.
Thank you for any guidance.
Here is a sample data structure: [ { hi: "bungalo" }, { hi: 'bodego' }, { hi: 'bodego' }, { hi: 'pet rock' } ]
[ [ { snail: 'big' }, { snail: 'big' } ], [ {snail: 'small' }, {snail: 'small'} ] ]
[ { hi: "bungalo" }, { hi: 'bodego' }, { hi: 'bodego' }, { hi: 'pet rock' } ]