F
Size: a a a
F
NS

const opeks = {};
const arr = source.map(item => {
const label = item[1];
opeks[label] ??= {count: 0};
return addDays(item, opeks[label].count++);
});
быстрее чем const opeks = {};
const arr = source.map(item => {
const label = item[1];
opeks[label] ??= 0;
return addDays(item, opeks[label]++);
});
https://jsben.ch/iPvq6S
AE
S
DF
AE
S
IN
NS
AE
M
IS
IN
IS
M
IS
IN