I have an array customers declared outside of firebase ref.once() function.
var customers = [];
I am changing the value of the array within ref.once() and trying to access the modified value out of ref.once(). But it returns the initial value [].
Here is my code
var customers = [];
var nameRef = new Firebase(FBURL+'/customerNames/');
nameRef.once("value",function(snap){
customers.push("test");
});
console.log(customers); // returns []