This question already has an answer here:
I am unable to use the variable "name" outside of this function. I can use this further down the code if I nest the rest of the code in the same function.
var name;
controller.storage.users.get(message.user, function(err, member) {
name = member.real_name
});
console.log(name)
Thanks.
via Brad Osborne
No comments:
Post a Comment