Делаем ровно то, что спрошено:
const result = Object.values(arr.reduce((acc, n) => {
(acc[n.name] ??= ({ ...n, count: 0 })).count++;
return acc;
}, {}));
Или, решаем задачу в более общем виде:
function uniqueWithCount(data, key, countKey) {
const getKey = key instanceof Function ? key : n => n[key];
const unique = new Map;
for (const n of data) {
const k = getKey(n);
unique.set(k, unique.get(k) ?? { ...n, [countKey]: 0 }).get(k)[countKey]++;
}
return unique;
}
const result = [...uniqueWithCount(arr, 'name', 'count').values()];