How do you return a latitude and longitude array using the Google Javascript v3 Geocoder? [duplicate]
问题 This question already has answers here : Accessing array from outside of geocode loop (2 answers) How do I return the response from an asynchronous call? (36 answers) Closed 6 years ago . I'm trying to create a function that utilizes Google Javascript V3's geocoding capabilities and returns an array with the longitude and latitude. For some reason the return array is not being populated using the function. Thanks for your help! Code: function getCoords(address) { var latLng = []; var geocoder