I have wrote for the given data of code,but unable to combined for the one array of objects into another array of objects like as given below.
var data=[{x:10,y:30},{a:50,b:40}]
var data1=[{x1:10,y1:30},{a1:50,b1:40}]
function fctnCombind(){
for(var i in data){
for(var j in data1){
data[i].children=data1[j]
//console.log(data[i].children)
data[i].push(data[i].children)
}
return data;
}
}
And final output is given below:
[{x:10,y:30,c:[x1:10,y1:30]},{a:50,b:40,d:[a1:50,b1:40]}]