r/learnprogramming • u/Tough_Pride4428 • Aug 04 '23
Unexpected function problem.
I have a small problem that I create a project in js, css, html, which is launched locally in the browser and when everything I did last worked normally, when I launched the script the next day, one function stopped working completely and the other one works incorrectly. When I ran the script (the current version) the next day, I did not modify these functions in any way, I did not change their calling context, nor did I change other functions that affect them in any way. The console in the code editor as well as in the Chrome browser does not have a single syntax error, etc. I always make copies of the entire script so that I can restore something if I messed up in the current version, or I would like to restore something as I did in the previous version. In these older copies, these functions worked normally, nothing happened, now if I remove this current version of the code and put the old one, where these functions should work, it's the same problem. Anyone know what could have happened? I haven't changed any settings in the browser either. In this case, it can't be a problem with the code, but with something from the outside.
2
u/[deleted] Aug 04 '23
Don't work like this, acquire good work habits from the beginning - use Git. This way you could watch changes and history of code, compare between current and previous version and see what has changed. You could also share your code on Github with others so they can give you feedback. Hard to tell exactly without seeing the code.