Closed Erkalos closed 4 years ago
Hi, I'm a begginer and I don't know why I don't have the result if I do something like this :
exports.sites = function(url) { const res = superagent.get(url).set('accept', 'json').catch(console.error).then(res => { return JSON.stringify(res.body); }); }
The request is working fine. I have the output if I replace return by console.log. I would like to be able to get a return for another function. How I can do that ?
may try to returning res variable after declaration
Hi, I'm a begginer and I don't know why I don't have the result if I do something like this :
The request is working fine. I have the output if I replace return by console.log. I would like to be able to get a return for another function. How I can do that ?