How can identify which of the variables are used as Global variables across multiple scripts?
I am trying to solve an error that occors in a web-page that I didn't write.
The web-page imports many different scripts, written in Vanilla JavaScript
.
Appearently, there are a few common variables that are used accross multiple script files, which is the cause for the problem.
Changing all the types from let
to var
- by using 'replace' (cntl+h on vscode in the combined file) - solved the issue.
Seems that the former programmer used something like this - Can I access variables from another file?
Anyway, in order to fix it, I would like to identify which are the common variables and what scripts using them.
What is the best way to do so?