I have this array of message objects and I wanted to group them that have similar from - to value or vice versa.
message
from - to
const msgs = [ {