问题 I have array of object const users = [ { group: 'editor', name: 'Adam', age: 23 }, { group: 'admin', name: 'John', age: 28 }, { group: 'editor', name: 'William', age: 34 }, { group: 'admin', name: 'Oliver', age: 28' } ]; Expected result: //sum sumAge = { editor: 57, // 23+34 admin: 56 // 28+28 } //average avgAge = { editor: 28.5, // (23+34) / 2 admin: 28 //(28+28)/2 } I use reduce() method to group the objects in an array by 'group' and calulate sum: let sumAge = users.reduce((group, age) =>