[
{test: 'as', test1: 'asss', test2:[{hello: 'a', hell: 'b'}, {hello: 'a', hell: 'b'}]},
{test: 'as', test1: 'asss', test2:[{hello: 'a', hell: 'b'}, {hello: 'a', hell: 'b'}]},
{test: 'as', test1: 'asss', test2:[{hello: 'a', hell: 'b'}, {hello: 'a', hell: 'b'}]}
]
[
{test: 'as', children: [{hello: 'a'}]},
{test: 'as', children: [{hello: 'a'}]},
{test: 'as', children: [{hello: 'a'}]}
]
var a = [
{test: 'as', test1: 'asss', test2:[{hello: 'a', hell: 'b'}, {hello: 'a', hell: 'b'}]},
{test: 'as', test1: 'asss', test2:[{hello: 'a', hell: 'b'}, {hello: 'a', hell: 'b'}]},
{test: 'as', test1: 'asss', test2:[{hello: 'a', hell: 'b'}, {hello: 'a', hell: 'b'}]}
]
var b = []
a.forEach(function(item){
b.push({test: item.test, children: [ { hello: item.test2[0].hello } ] })
})
b