When I call This function:
function getweb(addr){
request(addr, function (err, response, body) {
let artlatestjson = JSON.parse(body);
aart = artlatestjson.title;
alink = artlatestjson.url;
ascore = "| Score " + artlatestjson.score;
return(aart)
});
}
With:
console.log(getweb(jsonfileaddres))
(jsonfileaddres being url of the json file)
It allways returns undefined, even though aart is set to the corect thing.