data.coord
won't give you [ 'lon', 'lat' ]
array, rather it would give you { "lon": 159,"lat": 35 }
object.
You can get their values just like you would get value of any object like: data.coord.lat
and data.coord.lon
So something like
var latitude = data.coord.lat;
var longitude = data.coord.lon
EDIT:
Similarly, for weather you can access weather using data.weather
, however thing to note is that weather is an array. So, you can get hold of 1st element using index=0.
Effectively, you'll write, var myWeatherObject = data.weather[0];
//0 is index of 1st element
Again, to access individual weather properties, you can use:
myWeatherObject.id
, myWeatherObject.main
, myWeatherObject.description
and myWeatherObject.icon