In practice, it can affect the browser, at some point under editing the code, to use the previous version of the code, and not your current one.
You can clear the browser cache to avoid such behavior, or use some trick. The meaning of the latter is as follows - when we include the script, we put a question mark, an equal sign and the version number of your script after the file name. When the browser caches the file, you just need to increase the version number by one.
See an example:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <script src="script.js?v=1"></script> </head> <body> </body> </html>
Correct your file inclusion such a way that the file name is followed by its version number.