12345678_0001
只能循环遍历var ret = {};for(let person of a) {
let { id, name, age } = person; if(ret[id]) {
ret[id].name = [].concat(ret[id].name, name);
ret[id].age = [].concat(ret[id].age, age)
} else {
ret[id] = { id, name, age }
}
}
ret = Object.values(ret);
console.log(ret);