If the computer and your program are guaranteed to run the entire time, you can keep data in a variable in RAM. However, when your program is restarted, all variables are lost, and you need to figure out a more permanent storage such as a file or a database.
Also, Javascript? Are you running a script in a web page in the browser? This further increases risks that the user closes your tab and the variable is lost.
Ofc Im running the script in a web page, its my own project where I developing my code skills using this project, I just wanna see I get it done, cuz ive spending up 6 days trying to figure out how to solve that problem lol I ended up posting this post instead of ask ai for a help
View all comments
Show parent comment
5
u/buzzon 3d ago
If the computer and your program are guaranteed to run the entire time, you can keep data in a variable in RAM. However, when your program is restarted, all variables are lost, and you need to figure out a more permanent storage such as a file or a database.
Also, Javascript? Are you running a script in a web page in the browser? This further increases risks that the user closes your tab and the variable is lost.