var b = 2;
function fun(){
console.log(b);
if(b==2){
function b(){
console.log(111);
}
console.log(222);
}else{
console.log(b);
};
}
fun();
为什么打印出来的是两个undefined 而不是两个2,我调试了一下 看到执行步骤,监视变量b,确实是undefined,但我不知道为什么?
新world
phper_linuxer
随时随地看视频慕课网APP
相关分类