I am trying to create an associative array for the first time and acces data with keys. My array builds fine but I am having a hard time figuring out how to get to the data. The console.log at the end returns undefined.
placesdata = [];
$.getJSON("php/data.php", function(data) {
$.each(data.places, function(j,val){
placesdata.push({
placename: data.places[j].name,
placedescription: data.places[j].notes,
placelong: data.places[j].lon,
placelat: data.places[j].lat,
});
});
for(var i=0; i< placesdata.length; i++){
console.log(placesdata[i][0]);
}
});
Thanks!