I'm remapping JSON objects received from an API which works perfectly. The issue is instead of pushing into a single array searchResultsReFormat, in the console it reads the same line multiple times but with different values.
searchResultsReFormat: any = [];
this.searchResults.map(result => {
const customer = result.customer
const meals = result.meals
const newResults = [{
firstName : customer.firstName,
lastName : customer.lastName,
grade: this.gradeName,
meals: [meals]
}]
console.log(newResults)
this.searchResultsReFormat = newResults
})
but It all should have been grouped inside one single array searchResultsReFormat and when expanded, the data will be showing

.mapactually do?