Quick question. I have the "list" variable and it looks like this:
var list = [ { appid: '753', contextid: '6', assetid: '3351193666' },
{ appid: '255710', contextid: '6', assetid: '4141511622' },
{ appid: '255710', contextid: '6', assetid: '4356835667' },
{ appid: '255710', contextid: '6', assetid: '4145011657' },
{ appid: '255710', contextid: '6', assetid: '4356835665' },
{ appid: '255710', contextid: '6', assetid: '4356835666' },
{ appid: '730', contextid: '6', assetid: '4356832195' },
{ appid: '730', contextid: '6', assetid: '4356832197' },
{ appid: '730', contextid: '6', assetid: '4356832196' },
{ appid: '321040', contextid: '6', assetid: '3682654698' },
{ appid: '321040', contextid: '6', assetid: '3542604179' },
{ appid: '322330', contextid: '6', assetid: '3498901747' },
{ appid: '322330', contextid: '6', assetid: '3903574578' },]
I tried different sorting options, but somehow my logic fails every time to sort them by groups. As you can see, the contextid is not important since it is the same everywhere. The appid can repeat itself but the assetid is always different.
I would really like to sort these "assets" in different groups by appid. For example:
var groups = [{appid: '753', assets: [{contextid: '6', assetid: '3351193666'}]},
{appid: '255710', assets: [{contextid: '6', assetid: '4141511622'}, {contextid: '6', appid: '4356835667'}, {contextid: '6', appid: '4145011657'}]}
....];
If someone could help me, that'd be extremely great. I really can't grasp my mind around this, and I've pretty much ran out of ideas. Sorry if it's a dumb question..