I have JSON array like this:
var items = [
[{id:1,name:'test'},{id:2,name:'test'},...] ,
[{id:1,name:'test'},{id:2,name:'test'},...] ,
]
From that I need an array like this:
var newArray = [
{ id: 1, name: 'test' }, { id: 2, name: 'test'}, { id: 3, name: 'test'}, ...
]
Now I am using a for
loop on items
array and storing into newArray
but is there any other method without using loops?