I want to print expected output values in two loop using map, Can you please help me.
var data=[{'2021':['Q2 2021','Q3 2021','Q4 2021']},
{'2022':['Q1 2022','Q2 2022']}
]
data.map((obj,ind)=>{
console.log(Object.keys(obj));
Object.keys(obj).map((yearQuarter, i) => {
console.log(obj[yearQuarter]);
})
})
//getting output
//['2022']
//['Q1 2022', 'Q2 2022']
//Expected Output
//'2022'
//'Q1 2022`
//'Q2 2022`
` – flyingfox Oct 21 '22 at 11:17
` instead of `\n` – flyingfox Oct 21 '22 at 11:28