When JS is executed within a browser context, variables declared in the global scope or initialized without declaration (without the var keyword) are stored and read in the window object automatically. So if you create a variable say, at the top of your file, it's still going to be accessible in any other JS code that runs on the page.
However, because such variables pollute the global namespace, it's a good idea to create a container object which will store all shared data. At the top of all files, add something like:
myContainer = myContainer || {};
This creates the myContainer global object if it didn't exist, but it doesn't change anything if it did.
The fact that variables are global by default is why many libraries wrap themselves in a closure. To make sure that none of the variables in your code get overwritten by code from another file, you should do something like this:
myContainer = myContainer || {};
(function(){
var someVariable; // not accessible in other files
myContainer.sharedVariable = 10; // accessible in all files
})();
Note that this still isn't "safe" in the sense that myContainer is global and could be overwritten by any code similar to myContainer = something.