I keep seeing warnings not to use global variables in JavaScript, but it seems that the only reason people say that is because the clogs up the global namespace. I can imagi
The global variable which you have created might overwrite the existing window object properties. Because the global variables are accessing in global context i.e. window object.