My dilemma involves an object structured as follows:
[{
Date: 01/11/2022,
Questionnaire: [
{Title: 'Rating', Ans: '5' },
{Title: 'Comment', Ans: 'Awesome' }
]
},
{
Date: 01/11/2022,
Questionnaire: [
{Title: 'Rating', Ans: '2' },
{Title: 'Comment', Ans: 'Bad' }
]
},
{
Date: 09/12/2022,
Questionnaire: [
{Title: 'Rating', Ans: '3' },
{Title: 'Comment', Ans: 'Okay' }
]
}]
My goal is to structure a new object in the following way:
[{
Date: 01/11/2022
Ratings: ['5', '2']
},
{
Date: 09/12/2022
Ratings: ['3']
}]
I am attempting to filter this data by date and extract all the ratings for each specific date.