Hi everyone, so this project is about generating random message and basically logs it on the terminal. I do not decide to make it interactive or bring it on the web page because I think I will do it later when I have enough experience and knowledge later on the course.
And everything so far is so good. But there is one problem I encounter when doing this project. In this project I have a text file called “facts.txt”. I want to read this file and put it into the array by splitting ‘newline’ character. Everything works fine until I notice that the data of the ‘facts’ variable outside the callback function is destroyed. Anyone knows the reason why and how can i store the data permanently inside the ‘facts’ array when I finish reading the text file.
The code I have problems with is as below:
my github project: GitHub - ThanhHieuDang0706/codecademy-mixed-message: Codecademy Portfolio Project
It woulld be very great if you guys can review my code too.
Thank you for helping.