let comparetable = [
{
id: "F75",
name: "testuser1",
type: "student",
2022: [
{
subject1: 12,
subject2: 12,
subject3: 39
},
{
subject1: 12,
subject2: 12,
subject3: 39
}
],
2021: [
{
subject1: 12,
subject2: 12,
subject3: 39
},
{
subject1: 12,
subject2: 12,
subject3: 39
}
],
},
{
id: "F756",
name: "testuser2",
type: "student",
2022: [
{
subject1: 12,
subject2: 12,
subject3: 39
},
{
subject1: 12,
subject2: 12,
subject3: 39
}
],
2021: [
{
subject1: 12,
subject2: 12,
subject3: 39
},
{
subject1: 12,
subject2: 12,
subject3: 39
}
]
},
]
What I have tried:
how to iterate nested array in tbody. here year only contain in array need to loop that in same table, i was tried out with initially i was iterate array and check object.key is array and then tried to loop in tbody .