AY
Size: a a a
AY
D🦆
AY
D🦆
AY
D🦆
AY
D🦆
AY
AY
D🦆
AY
const id = x => x;
const groupBy = (items, fn = id) => {
const res = {};
items.forEach(i => {
const key = fn(i);
res[key] = res[key] || [];
res[key].push(i);
});
return res;
};
groupBy([0, 1, 2, 3], n => n % 2) -> { 0: [0, 2], 1: [1, 3] }
D🦆
const id = x => x;
const groupBy = (items, fn = id) => {
const res = {};
items.forEach(i => {
const key = fn(i);
res[key] = res[key] || [];
res[key].push(i);
});
return res;
};
groupBy([0, 1, 2, 3], n => n % 2) -> { 0: [0, 2], 1: [1, 3] }
AY
D🦆
ГК
AY
AY
EC