I have an array with multiple objects. In this array each objects having two or more sub objects. I want to get together all sub objects into an array of data. How to do with javascript?
var array1 = [
{
"dfgasg24":{
name:"a",
id:1
},
"dfgare24":{
name:"b",
id:2
}
},
{
"wegasg24":{
name:"ab",
id:76
},
"yugasg24":{
name:"bc",
id:34
},
"yugasg26":{
name:"dc",
id:45
}
}
]
The output which i want to be like this,
var result = [
{
name:"a",
id:1
},
{
name:"b",
id:2
},
{
name:"ab",
id:76
},
{
name:"bc",
id:34
},
{
name:"dc",
id:45
}
];