I have a current project in which I'm dealing with an object that has three separate arrays of objects.
Here's a glimpse of the structure...
[
Array 1:[
{ key: value}
],
Array 2:[
{ key: value},
{ key: value}
],
Array 2:[
{ key: value},
{ key: value}
]
]
My goal is to combine all these objects into a single array instead of keeping them in separate arrays.
I attempted to achieve this by using angular.forEach to loop through and push the objects into a new array, but I've encountered some issues.
var newArray = [];
angular.forEach(result, function(value, key){
newArray.push(value);
});
return newArray;
Your insights on how to approach this would be greatly appreciated!
Thank you!