JSON RESPONSE AFTER .JSON Is Called
registerResponse is an API call for clarifaction
{
"person": {
"name": "jeff",
"state": "Florida",
"city": "miami"
},
"food": "tacos",
"drink": "water"
}
let response = registerResponse()
console.log(response.json().food)
console.log(response.json().person.state)
the first log input works but the second input throws an error. "cannot read property 'state' of undefined" is there a reason this is happening am i doing it wrong? I can remove state but then it just returns null. I'm suspecting the .json() method is not good with nested objects