Can someone please explain to me why the code below executes the "F" alert first , then the "S' and "V' ALERTS.
var status = ' ';
database.ref('housekeeping/ongoing').once('value', function(snapshot){
alert(status + "S");
status = snapshot.val();
alert(status + "V");
});
alert(status + "F");