当变量 n 是全局变量时,为什么在下面的 if 语句中变量 n 会变为未定义?
function aisaRev() {
n=n; //globally n=0
console.log(n);
hover=1;
rev=2;
//n counts up to 39 and then becomes undefined when it hits the else statement
if (n<=aisaArray.length){n++}else{n=0; console.log(n)};
world();
}