var getListings = function () {
    listingsRef.once("value").then(function(snapshot) {
        console.log(snapshot.val());
    }, function (errorObject) {
        console.log("The read failed: " + errorObject.code);
    });
};
I have the following method. console.log(snapshot.val()) is working as expected. However, if I return snapshot.val() it returns undefined. I cannot seem to figure out how to do var currentSnapshot = getListings()
 
     
    