I want to get the current user to use in public but outside the Parse.User.currentAsync().then(function(user) current user is undefined, How can I pass it to a variable ??
var userName;
Parse.User.currentAsync().then(function(user) {
userName = user.get('username')
});
alert(userName) //undefined
......
user.equalTo("username", userName); //userName is undefined
user.find().then(results => {
for(const result of results) { ....