t
const temp = arr.reduce((acc, elem) => {
const key =
${elem.a}${elem.b}
.split('').map(e => e.charCodeAt()).reduce((total, amount) => total + amount); if(!acc[key]) {
acc[key] = [];
}
acc[key].push(elem);
return acc;
}, {});
return Object.getOwnPropertyNames(temp).map(k => temp[k]);
} норм решение?