let list=[ {id:1,name:'a'}, {id:1,name:'b'}, {id:1,name:'c'}, {id:2,name:'A'}, {id:2,name:'B'}, {id:2,name:'C'}, ] //对象嵌套数组--{id:[name]} let objList=list.reduce((obj,item)=>{ obj[item.id]?obj[item.id].push(item.name):obj[item.id]=[item.name] return o