How can I get the value of the variable 'clickedName' outside the function 'getClickedName()'?
var clickedUidName = firebase.database().ref('users/' + clickedRefUid + '/name');
clickedUidName.on('value', function getClickedName(snapshot){
var clickedName = snapshot.val();
});