I an a newbie to javascript/nodejs. I am currently trying to access data from one of the open weather API's using the request something like
var url='http://api.openweathermap.org/data/2.5/weather?q=${city}&units=imperial&appid=${apikey}';
resBody=request(url, function(err,res,body){
return body}
when I do a console.log(body)
inside the function i get the expected results but same is not available on console.log(resBody)
the results are different.
What am I missing. Can you please help here.