I have an Object with nested key value pair as:
Products:{
Clip:{
today_entry: 0,
today_sold: 0
},
Necklace:
{
today_entry: 0,
today_sold: 2
}
}
I want to loop through the Objects Clip ad Necklace and group the values as per their inner keys i.e. today_entry, today_sold into the format:
{
today_entry : [0,0],
today_sold : [0,2]
}
I tried doing it using Object.entries but since it is nested I'm not able to get the inner keys. Could anyone please help me? Thank you.