I'm using Firebase to access to same data, but i can't use the data out of the function used to access it. How i can make a console log of the data just accessed instead of the initial value?
var whatNeed = 'hello';
gameData = new Firebase('https://thegame.firebaseio.com/gameData');
    gameData.on("value", function(snapshot) {
        var data = snapshot.val();
        whatNeed = data.property;
    });
console.log(whatNeed);
 
    