如下js问题
functionfunA(){vari=0;functionfunB(){i++;alert(i);}allShowC=function(){//allShowC引用匿名...
function funA() {
var i = 0;
function funB() {
i++;
alert(i);
}
allShowC = function () { // allShowC引用匿名函数,与funB共享变量i//
i++;
alert(i)
}
return funB;
}
var allShowA = funA();
var allShowB = funA();运行不出来 展开
var i = 0;
function funB() {
i++;
alert(i);
}
allShowC = function () { // allShowC引用匿名函数,与funB共享变量i//
i++;
alert(i)
}
return funB;
}
var allShowA = funA();
var allShowB = funA();运行不出来 展开
展开全部
<script>
function funA() {
var i = 0;
function funB() {
i++;
alert(i);
}
allShowC = function () { // allShowC引用匿名函数,与funB共享变量i//
i++;
alert(i)
}
return funB;
}
var allShowA = funA();
var allShowB = funA();
allShowA();
allShowB();
</script>
function funA() {
var i = 0;
function funB() {
i++;
alert(i);
}
allShowC = function () { // allShowC引用匿名函数,与funB共享变量i//
i++;
alert(i)
}
return funB;
}
var allShowA = funA();
var allShowB = funA();
allShowA();
allShowB();
</script>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询