I Have next map:
const filter = new Map();
filter.set('a1', {
Day: 55,
Type: 1,
});
filter.set('a2', {
Day: 2,
Type: 3,
});
And next Array:
Data = [
{
points: 1,
event: 'a1',
},
{
points: 2,
event: 'a2',
},
]
I am new in JS, so it is not clear for me, how I can merge these by event parameter?
Expected output should be Map:
result = ['a1',
{
points: 1,
Day: 55,
Type: 1,
}],
['a2',
{
points: 2,
Day: 2,
Type: 3,
}],