I have an array of objects coming from an api that looks like this
[{"HomeTeam": "HOU"}, {"AwayTeam": "GB"}, {"HomeTeam": "DAL"}, {"AwayTeam": "TB"}]
I'm using map to map over the objects and get the team names to put them into react table like this.
const results = data.map((teams) => ({
"Teams": // I need both teams here
}))
How can I map over the array and get both HomeTeam and AwayTeam values into Teams values?
I need the final object to look like this
[{"Teams": "HOU"}, {"Teams": "GB"}, {"Teams": "DAL"}, {"Teams": "TB"}]