Below is the provided dataset:
collection = [{
date: '2020-12-01',
data: [{
id: 'A1',
name: 'A1',
date: '2020-12-01'
},{
name: 'A2',
date: '2020-12-01'
},{
name: 'A3',
date: '2020-12-01'
}]
},{
date: '2020-10-02',
data: [{
name: 'B1',
date: '2020-10-02'
},{
name: 'B2',
date: '2020-10-02'
},{
name: 'B3',
date: '2020-10-02'
}]
},{
date: '2020-10-03',
data: [{
name: 'C1',
date: '2020-10-03'
},{
name: 'C2',
date: '2020-10-03'
},{
name: 'C3',
date: '2020-10-03'
}]
}];
collection.map((DATA: any) => {
_COL = _.cloneDeep(DATA['data']);
})
Could you please assist with merging the multiple arrays in _COL
? I'm encountering an error when attempting to use the findIndex function and equating it to the inputed id, which prevents a successful display.