I have used async/wait a little within functions. And I know about callbacks but for some reason I can't get what i want to work. This is essentially what I want to do.
T.get('friends/ids', myAcc, function(err, data, response){
friends = data;
});
console.log(friends);
what happens is it does the console log before getting the friends.
i know if I do this, it will work
T.get('friends/ids', myAcc, function(err, data, response){
console.log(data);
});
but how can I wait for the function its self to complete? Without surrounding them with another async/aawait function?