Async JS is not my thing.
I have something that looks like this:
function GetData() {
http.get(options, function (error, response, body) {
return JSON.stringify(body.results[0].members);
});
}
var list = GetData();
console.log(list);
This of course does not work. list is "undefined," presumably because console.log runs before GetData has a chance to return. I've been struggling way too long with this. Is there a short, simple fix?