I’m new to Javascript and I’m not understanding how to persist data in an array. In my function I’m reading a file line by line and saving it in an array. I figured that because the array is declared outside the function that data would remain in it, but that’s not what happens. I would like to understand how to
Tag: readline
readline not pausing for or allowing input
Here is my code: (The console.log()s are just so I can see what code is evaluated and which isn’t) This just returns What do you want me to do?2 over and over again. It also doesn’t let me type anything in to the console. How can I fix this? I’ve looked all over and haven’t found anything. Answer while (true)