I will like to print [4, 5, 2]
as the value of supervisors in the following nested array/objects.
var data = {
supervisors: [
{
0: [
{
id: 4,
name: "Reporter"
}
]
},
{
1: [
{
id: 5,
name: "Officer"
}
]
},
{
2: [
{
id: 2,
name: "Coordinator"
}
]
},
]
};
How can I loop through the data?