let json = [ {
"name":"vay",
"age":26,
"children":[
{"name":"Ajay",
"age":16,
"children":[
{
"name":"kojay",
"age":26,
"children":[
{
"name":"dija",
"age":"4"
}
]
}
]
},
{
"name":"kojay",
"age":26,
"children":[
{
"name":"dija",
"age":4
}
]
}
]
}]
`let array=[]
function r(json){
for(let i=0;i<json.length;i++){
array.push(json[i])
function e(jso){
if(json[i].children!=null){
json[i].children.map((x)=>array.push(x))
}
}
e(json[i])
}
}
`
Top comments (0)