I will like the convertToLat() function to return the variable lat from the nested function. I have tried many ways but it just can't seem to work. Any help will be appreciated. Thank you.
function convertToLat(postal_code) {
$.getJSON("http://maps.googleapis.com/maps/api/geocode/json?address=" + postal_code, function(result){
var lat = result.results[0].geometry.location.lat;
return lat;
});
return function();
}