I'm trying to access the locations array from my javascript object and store it.
data = [{
"id":123,
"name":"John",
"locations":["Smith","McHale","Residence 4"]
}]
I've tried things like:
locations = data['locations'] and data.locations. But both return undefined. What am I doing wrong? How can I just grab the locations array to store in its own variable? (Not using Jquery) Thank you for your help advance!
[ ]on an object. Using those brackets will put it in an array.