Help me get the array of all student's id and college id from the following JSON data. I want to have;
//to store id of all colleges.
var collegeid = [];
//store id of all students.
var studentsid = [];
//students id as per college:
var studentsIdInCollege1 = [];
var data = {
"college":[
{
"id":1,
"school":"abc",
"course":"cde",
"students":[
{
"id":1,
"name":"abc 123",
"number":"156888"
},
{
"id":2,
"name":"abc 123",
"number":"156888"
}
]
},
{
"id":2,
"school":"xyz",
"course":"lopl",
"students":[
{
"id":3,
"name":"abc 123",
"number":"156888"
},
{
"id":4,
"name":"abc 123",
"number":"156888"
}
]
}
]
}
`