I've been trying to retrieve the data from my JSON file, but I keep getting an error in the console that says "Uncaught TypeError: Cannot read property 'longitude' of undefined." This method is new to me and I would really appreciate any help you can offer. Thank you!
var data = [];
$(document).ready(function(){
$.ajax({
url: 'http://******',
type: 'get',
dataType: 'JSON',
success: function(response){
data.push(response);
}
});
});
console.log(data[1].longitude);