Tuesday, 2 July 2019

javascript - How do I return the var in this function from request?

Is it possible for me to get the data from body.message to use outside that function?



I've tried this so far.



    var codetocheck;
request({
url: link,
json: true
},function (err, resp, body){
codetocheck = body.message;//var I want to use outside this function

})

No comments:

Post a Comment