慕工程0101907
function handle (arr) { var res = [], obj = {}, index = 0; arr.forEach(val => { if (obj.hasOwnProperty(val.cag)) { res[obj[val.cag]].item.push(val); } else { obj[val.cag] = index++; res.push({ slug: val.cag, item: [val] }); } }); return res;}