After running a console.log
, I found my array structured like this:
[
{
Country: 'US',
CityName: 'Seattle',
Region: 'WA',
PostalCode: '99301',
StreetName: '3512 Alaska Street'
},
to_EmailAddress: { results: [ [Object] ] }
]
Surprisingly, the array length is 1 instead of 2. So, when I call console.log(arr[0])
, it displays:
{
Country: 'US',
CityName: 'Seattle',
Region: 'WA,
PostalCode: '99301',
StreetName: '3512 Alaska Street'
}
Attempting to access arr[1]
gives me undefined
.
I'm struggling with how to retrieve the value of to_EmailAddress
. Even more so, how can I incorporate
to_EmailAddress: { results: [ [object] ] }
into the first element in the array. Essentially, what I want is:
[
{
Country: 'US',
CityName: 'Seattle',
Region: 'WA',
PostalCode: '99301',
StreetName: '3512 Alaska Street',
to_EmailAddress: { results: [ [Object] ] }
},
]
Unfortunately, I am unsure how to achieve this since I cannot even access the to_EmailAddress
attribute.