March 15th, 2017, 03:38 PM
Can't access data inside curly brackets
I have some data passed to me as 'data' and when I do console.log(data.person) I see the returned structure as
Now, Person is defined like this
but when I do console.log(data.person.Person) I get an error of Person is undefined or possibly null if I'm misremembering. How do I access "first" value?
Last edited by drhowarddrfine; March 15th, 2017 at 03:42 PM.
March 15th, 2017, 04:03 PM
What you're saying doesn't make sense.
If the console.log(data.person) showed you a Person object then you should be doing data.person.first and data.person.last.
March 15th, 2017, 04:09 PM
That's what the problem is! I forgot that it's an object! Too many things going on. Thanks