I have an array with child array and I want to concat items from data to new array like below. How I can do it?
Example:
[
{
"title": "Javascript 1",
"data": [
{
"text": "hello world 1"
},
{
"text": "hello world 2"
},
]
},
{
"title": "Javascript 2",
"data": [
{
"text": "hello world 3"
},
{
"text": "hello world 4"
},
]
},
]
The result as expected:
[
{
"text": "hello world 1"
},
{
"text": "hello world 2"
},
{
"text": "hello world 3"
},
{
"text": "hello world 4"
},
]