I have many points on Google Maps and I want to show for each point the nearest city (so a reverse geocoding). I have a multidimensional array like this:
Google Maps
You may want to sort after the second array element:
citta_vicine.sort(function(a, b) { return a[1] - b[1]; });