I have product groups and product_type_ids in each group are keys to identify product groups.
I need to match different groups by comparing each product_type_id in the group, and product_type_ids may be in different order but the set of the ids must match to make the decision.
So, rather than looping through each item in the array to find the match, is there any other method or way to figure out if they match.
Here is some sample data that will help my question to clarify.
Group Name | Product Type IDs
GR1 | 1,2,14
GR2 | 2,7,8
GR3 | 4,5,6
GR4 | 2,14,1
GR5 | 2,14
Note: IDs are not quite random, except GR5, they give a total of 17 (= 1+2+14).
So, can i know GR1 and GR4 are a match?
I need this for Javascript, more precisely for AngularJS if that makes any change.
Thanks.