I need a small Help in JS? i want to access mail_address of this nested object, how will I do it
const data =
{ members:
[ { id : '7d8c03e88a8386f6453340c1db56'
, mail_address : 'trial.om'
, uniqsl : 'c6cce01'
} ] }
const data = {
members: [
{
id: '7d8c03e88a8386f6453340c1db56',
mail_address: 'trial.om',
uniqsl: 'c6cce01',
}
]
}
console.log(data.members[0].mail_address) // Prints "trail.om"
members is a array of objects, but it has one single element. You access this element at the index 0.