SS
acc[key] = value * 10;
return acc
},{})
Size: a a a
SS
OM
OM
А
OM
В
SS
SS
OM
OM
OM
K
const result = Object.entries(funnelData).reduceRight(
(acc, [currentKey, currentValue], index, array) => {
const prev = array[index + 1];
if (prev) {
const [prevKey] = prev;
acc[currentKey] = acc[prevKey] + currentValue;
} else {
acc[currentKey] = currentValue;
}
return acc;
},
{}
);
OM
А
А
В
В
OM
const result = Object.entries(funnelData).reduceRight(
(acc, [currentKey, currentValue], index, array) => {
const prev = array[index + 1];
if (prev) {
const [prevKey] = prev;
acc[currentKey] = acc[prevKey] + currentValue;
} else {
acc[currentKey] = currentValue;
}
return acc;
},
{}
);
A