var data = [
{ 'Specials 5': 2192, 'dates': '2021-06-14' },
{ 'Specials 8': 767, 'dates': '2021-06-16' },
{ 'Specials 13': 2264,'dates': '2021-06-18' },
];
The Challenge is that Specials are constantly changing keys that only access the dates key-value pair. I would like the output to be as follows: I aim to have unique entries for each date with all specials included. Desired Output
var totalUserJoined = [
{
'Specials 5': 2192,
'Specials 8': 767,
'Specials 13': 2264 ,
'dates': '2021-06-14'
},
{
'Specials 5': 2192,
'Specials 8': 767,
'Specials 13': 2264 ,
'dates': '2021-06-16'
},
{
'Specials 5': 2192,
'Specials 8': 767,
'Specials 13': 2264 ,
'dates': '2021-06-18'
}
];