This is somewhat complex for me to put into words properly, so I'll just drop an example of what I'm trying to do in terms of input and expected output below. I've tried a few things but they seem to be way more complex than needed, result in duplication issues, or flat out don't work. Thanks ahead of time for any help people can provide. And if there's already a post that answers this question, I am sorry and I'll gladly take that link - as I said, it's difficult to put this into words.
Input: Array of Objects
Ex:
[
{prop: 1},
{prop: 1},
{prop: 2},
{prop: 3},
{prop: 2}
]
OUTPUT: Array of arrays where all objects with some matching property are grouped. Ex:
[
[{prop: 1}, {prop: 1}],
[{prop: 2},{prop:2}],
[{prop:3}]
]