OK, I normally do C# and stay on the server side, but I have been attempting to get a little more proficient with javascript.
This may be a dumb question, but is javascript sometimes cached along with the page by the browser? Twice I have had something like this happen using VSCode and Live Server: spend a lot of time working on something. Make changes, save and reload in browser; sometimes close the browser to wipe session variables. Everything works as expected. Then I run into a problem that I can’t fix. Work on it for a couple of hours or more. Nothing works. Come back to it the next day and fire everything back up, and the same code goes right to work with me **making no changes whatsoever
As an example, I spent about three hours working on some code that threw an error every single way I tried it, but it looked like it should work. I posted a question on stackoverflow and the first response was that it looked fine to them and should work.
I go and try the block of code again and it works on the first try. At this point I feel kind of stupid, and I wasted a lot of time in the process.
This really never happens to me in C#, other than a handful of times. The issue in these cases was more of an IIS issue than a C# issue, though. I mean, I can kind of offer a rational explanation when it happened in these cases.
With javascript, I’m just left wondering how I managed to waste so much time on code that seemed like it was really working all along.
So is there some pro trick I should know that would save me some time? Clear the browser cache more? Some other secret?
Also, can’t really search for this, because the keywords turn up a metric ton of how to store variables in session/local storage!
Thanks,