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.
1
u/Tough_Pride4428 Aug 04 '23
Well, it's just that I built this function in a way that works. It's not a matter of I might have modified something or done something else that it doesn't work now. I care about this function because I don't see any other approaches to make it work like in this build.
It works all the time until some strange external factor comes along.
Also, debugging won't solve the problem at all, since the previous version of the entire application script was working all the time, and now it suddenly doesn't. That's a lot of logic says it can't be a script problem.