Say I want to console.log the name value in the following state in React:
state = {
editingToggle: false,
list : [
{id:1 name:'hello' address: '123 fake street'},
]
}
How would I be able to access only this value? I've tried console.log(this.state.list[1].name) console.log(this.state.list.name[1]) but to no avail.
Whenever I open up the browser console all I can see is undefined. Any help would be great
this.state.list[0].name