1
我注意到console.debug()并不总是按预期工作(至少在谷歌浏览器中)。例如,在以下代码中,console.debug(目录)正常工作,直到警报(目录)函数起作用。但是,当我说要停止从页面的警报窗口时,console.debug(目录)开始显示一个空数组([])。 但是,如果我在for循环中打印数组,我发现它不是真的空。console.debug()无法正常工作
var dirs = [ 0, 1, 2, 3 ];
console.debug (dirs);
alert (dirs);
该代码是通过
setInterval ("function_with_the_code()", 20)
对不起,但我仍然不明白为什么我的静态数组显示不正确,除非我把alert() –