Im learning javascript right now and working on a weather application using node and express. In short, I'm trying to use an api call from open weather map and assign it to a variable so I can access the values simlair to objects. I tried assigning the value to a variable but it doesnt print out the needed data when i try to access it.
var1=request.get(url, (error, response, body) => {
let json = JSON.parse(body);
console.log(json);
});
console.log(var1);//doesnt produce the data i need