阅读背景:

为什么我的全局数组索引在我需要时未定义?

来源:互联网 

I have the following code for opening up a file, reading it in line by line, and pushing each line to an array. I am able to console.log the line before I push it to the array, so I know it has a value as a line, at that stage. But I am then unable to console.log it after that as an element of the array. I figure this has something to do with scope, but I can't see why it doesn't work at all - It just logs as "undefined".I have the following code for opening up a file




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: