var address = [];
var result = '';
request(`https://maps.googleapis.com/maps/api/geocode/json?key=AIzaSyADhcyBu7Ce_cN8RUBTt4T1lBq2X6L-_-w&latlng=${lat},${lng}`, function(error, response, data) {
data = JSON.parse(data);
address.push(data.results[0].formatted_address);
result = data.results[0].formatted_address;
console.log(results);
});
results[i].address = result;
results[i].address = address;
}
我想从设置结果的请求函数中获取数据[i] .address = address;
请帮助我...