问题描述
我在todayscore
函数内定义了变量snapshot
,但不能在函数外使用该变量。
firebase.database().ref('path1/path2/path3/').once('value').then(function(snapshot) {
var todayscore = snapshot.child("key/").val();
});
todayscore = 100; //this appears not defined in console.
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)