const originalData = [ { name: ‘liu’, age: 30, score: 80, gender: 1, lesson: ‘math’ }, { name: ‘wu’, age: 31, score: 70, gender: 1, lesson: ‘math’ }, { name: ‘maks’, age: 27, score: 900, gender: 0, lesson: ‘math’ }, { name: ‘liu’, age: 30, score: 80, gender: 1, lesson: ‘english’ } ];
问题:返回一个平均分计算结果,按照 lesson
and gender
分组;
例如:returns { math: { 0: 73, 1: 82 }, english: { 0: 65, 1: 43 } }
答案:?