I am trying to combine multiple arrays of objects into a single array.
Here is an example with a transaction array that contains two different arrays:
transaction:
0:(3) [{…}, {…}, {…}]
1:(2) [{…}, {…}]
I would like the combined result to look like this:
transaction:
0:(5) [{…}, {…}, {…},{…}, {…}]
I am currently using a for loop to push arrays inside the transaction array, but I'm unsure how to use the concat operation within the loop.
Below is the for loop I am using to push objects into the transaction array:
for (var j = 0; j < $scope.allRecent.length; j++)
{
if (uniqueDates[i].dates == $scope.formatDate($scope.allRecent[j].date))
{
tempObj.transaction.push($scope.allRecent[j].transaction)
}
}