Quick Tip: The Problem With Implied Globals In JavaScript
One of the pitfalls a lot of JavaScript developers get caught by, especially when starting out, are implied globals. So what is an implied global?
implied = "global";
Any time you use a variable without having declared it using the var keyword, you are creating an implied global. When JavaScript is executed inside a browser the global object, for convenience, usually refers to the window DOM object. Any implied globals becomes a property of this global object so, the following is all valid:
implied …
