What happens is that the value I get without problems, but wanting to use it outside the code where I get the value, it disappears and does not show any data ...
This is the code where I collect the value "snapshot1" and I contain it in the variable "country", but when wanting to use the variable "country" outside that code, the value of "snapshot1" disappears.
firebase.database().ref().child("users empresas").child(useruid).child("País").on("value", function(snapshot1) {
var pais = snapshot1.val();
//console.log("El país del usuario es " + snapshot1.val());
});
Does anyone know how to use that value of snaptshot1 everywhere without problems?
I hope you can help me, thank you very much!