i apologize if it is already asked but i have searched all over the internet and nothing has worked i am working with firestore and javascript i have tried this by far & a lot of other things
var App
function A (){
firebase.database().ref('Info/').once('value').then(function(snapshot){
var Ipz = (snapshot.val() && snapshot.val().Iplist) || 'Anonymous';
console.log(Ipz)
})
console.log('A')
}
function B (){
console.log('B')
}
App = Promise.resolve();
App = App.then(A).then(B);
App.then(() => {
console.log("All done");
})
my output :-
A
B
All done
JdGJtwEe8rb394BlX4IkjUfH4Wv1;JdGJtwEe8rb394BlX4IkjUfH4Wv1;
while i want this output
JdGJtwEe8rb394BlX4IkjUfH4Wv1;JdGJtwEe8rb394BlX4IkjUfH4Wv1;
A
B
All done